I have an application where I'm using React. I have a problem now where I'm trying to implement the bootstrap-wysiwyg/bootstrap3-wysiwyg package.
In order to get my <textarea>
to work as the ootstrap-wysiwyg/bootstrap3-wysiwyg
text editor I need to run the following JQuery function on the text editor:
$(".textarea").wysihtml5()
Here's my component:
import React, { Component } from 'react'
export class MyTextEditor extends Component {
render() {
return (
<div className="form-group">
<textarea className="textarea"></textarea>
</div>
)
}
}
How can I apply that JQuery function to my <textarea>
in the React component?
I know it's not very good practice to blend React and JQuery but I really need this to work. If there is an alternative method to getting the package to work I would appreciate that as an answer instead.
Otherwise if anyone can help me get this to work it would be much appreciated!
Update: (Still looking)
Thanks for all the suggestions. I've tried a bunch but they've all led to problems:
<ReactQuill>
just doesn't display well at all, buttons are gigantic.<EditableDiv>
gives me:Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs.
- Syam Mohan's answer gives me:
Uncaught TypeError: Cannot read property 'font-styles' of undefined at f
Still in search for something that will work, thank you for all the efforts so far!