Open printjs opened 7 years ago
error
Uncaught Error: Objects are not valid as a React child (found: object with keys {Editor}). If you meant to render a collection of children, use an array instead.
code:
import * as React from 'react'; const Editor = require('react-draft-wysiwyg'); const styles = require('./editor.scss'); export class PlaceholderTextEditor extends React.Component<any, {}> { constructor(props: any) { super(props); } componentDidMount() { } render() { return ( <section className='placeholder-text-editor-panel'> <Editor /> </section> ); } }
without 'react-draft-wysiwyg' is normal.
environment
Hey @wjtGitHub , the trouble here is with import. Editor is not default export of the lib. Thus its not a valid react component.
Editor
@jpuri ,thank you. but, how to import react-draft-wysiwyg under typescript
react-draft-wysiwyg
error
code:
without 'react-draft-wysiwyg' is normal.
environment