diff --git a/README.md b/README.md index 7ef4b84..d9f7766 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # React Jodit Wrapper -A React wrapper for Jodit that supports SSR and it's fully written in Typescript. +A React wrapper for Jodit that works. [![NPM version][npm-image]][npm-url] ![ci](https://github.com/fedeorlandau/jodit-react-ts/workflows/CI/badge.svg) [![Downloads][downloads-image]][npm-url] @@ -62,6 +62,34 @@ const MyEditorWrapper = () => { }; ``` +## Config +- Example of jodit config + +```tsx +import * as React from 'react'; +import JoditReact from "jodit-react-ts"; +import 'jodit/build/jodit.min.css'; + +/** + * This needs to be defined outside the scope of our wrapper otherwise will cause multiple re-renders + **/ + +const config = { + preset: 'inline' +}; + +const App = () => { + const [value, setValue] = React.useState(); + + return ( + <> + setValue(content)} defaultValue="Hi" config={config} /> + {value} + + ); +}; +``` + ## Props diff --git a/example/index.tsx b/example/index.tsx index 24377ee..e0dfe60 100644 --- a/example/index.tsx +++ b/example/index.tsx @@ -2,7 +2,7 @@ import 'react-app-polyfill/ie11'; import * as React from 'react'; import * as ReactDOM from 'react-dom'; import JoditReact from '../src/'; -import 'jodit/build/jodit.min.css' +import 'jodit/build/jodit.min.css'; const App = () => { const [value, setValue] = React.useState();