Created
June 11, 2021 02:31
-
-
Save gitumarkk/9abd1947a8187e990ad805f99cfc0120 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import ReactQuill from 'react-quill'; | |
import 'react-quill/dist/quill.snow.css'; | |
/** | |
* MyEditor is a quill editor. | |
*/ | |
const MyEditor = ({id, setProps, value}) => { | |
return ( | |
<div id={id}> | |
<ReactQuill | |
onChange={(value) => setProps({value})} | |
value={value || ''} | |
/> | |
</div> | |
); | |
}; | |
MyEditor.propTypes = { | |
/** | |
* The ID used to identify this component in Dash callbacks. | |
*/ | |
id: PropTypes.string, | |
/** | |
* The edited content | |
*/ | |
value: PropTypes.string, | |
/** | |
* Dash-assigned callback that should be called to report property changes | |
* to Dash, to make them available for callbacks. | |
*/ | |
setProps: PropTypes.func, | |
}; | |
export default MyEditor; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment