Install N1ED React component
Install N1ED React package being in the directory of your project by NPM tool:
npm install --save @edsdk/n1ed-react
or for Yarn users
yarn add @edsdk/n1ed-react
Use N1ED component
Let's use N1ED in your project. Open your source file and in the top of it add new import:
import {N1ED} from "@edsdk/n1ed-react";
Then inside render()
method add N1ED component definition:
import React from 'react';
import {N1ED} from '@edsdk/n1ed-react';
import {Editor} from 'tinymce';
// ... and somewhere in render() function:
<N1ED
apiKey="APIKEY"
initialValue="<p>N1ED react demo</p>"
onEditorChange={handleEditorChange}
/>;
where handleEditorChange(htmlContent: string): void
is your own function you define as listener for change event.
You can also see demo TypeScript project on GitHub as example of use.
Check your installation
Now you can edit your articles with the power of N1ED. Go to your content and check N1ED in the action.