-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you install a plugin? #44
Comments
I'm experiencing the same issue, does anyone have an idea on how exactly should this be done? |
You need to find the npm module and install it (ex: npm i @dsvllc/summernote-image-attributes) , then import the plugin (ex: import ImagePulgin from '@dsvllc/summernote-image-attributes') in the component where you use and it should work. In case there is no npm module try: https://stackoverflow.com/questions/34424845/adding-script-tag-to-react-jsx |
Here is how I made it working :
import React from 'react'
import ReactSummernote from 'react-summernote'
import 'react-summernote/dist/react-summernote.css'
// ...
import 'plugin name here'
import 'plugin CSS file path here'
const MyComponent = () => (
<ReactSummernote options={{ ... }} />
)
export default MyComponent A non-NPM exampleLet's say I'd like to add the summernote-paper-size plugin which doesn't have a published NPM package, nor a
import React from 'react'
import ReactSummernote from 'react-summernote'
import 'react-summernote/dist/react-summernote.css'
import 'summernote-paper-size/summernote-paper-size'
const MyComponent = () => (
<ReactSummernote
options={{
['paperSize', ['paperSize']]
}}
/>
)
export default MyComponent I also added the line An NPM exampleLet's say I'd like to add the summernote-ext-print plugin :
import React from 'react'
import ReactSummernote from 'react-summernote'
import 'react-summernote/dist/react-summernote.css'
import 'summernote-ext-print'
const MyComponent = () => (
<ReactSummernote
options={{
['misc', ['print']]
}}
/>
)
export default MyComponent |
I tried adding a script for a plugin to the bottom of my react app, but it's not picked up when I add it to the plugins in React
I add the Summernote image attributes:
Then include in react:
But nothing changes
The text was updated successfully, but these errors were encountered: