wix-incubator / react-native-zss-rich-text-editor

React Native rich text editor based on ZSSRichTextEditor
Other
841 stars 311 forks source link

Invariant Violation: Element type is invalid: expected a string #149

Closed JeremyBradshaw7 closed 5 years ago

JeremyBradshaw7 commented 5 years ago

> Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object.

This error thrown on just trying the sample code on iOS and Android. I'm pretty sure I've done all the installation tasks correctly, including the webview-bridge.

import RichTextEditor from 'react-native-zss-rich-text-editor';

<RichTextEditor
  ref={(r) => this.richtext = r}
  initialTitleHTML={'Title!!'}
  initialContentHTML={'Hello <b>World</b> <p>this is a new paragraph</p> <p>this is another new paragraph</p>'}
  editorInitializedCallback={() => this.onEditorInitialized()}
/>

React Native 0.56

JeremyBradshaw7 commented 5 years ago

Found my mistake, should have been imported with:

import { RichTextEditor } from 'react-native-zss-rich-text-editor';

Please update your readme to include this!