0

I'm working on a react-app using draft-js but when I run my application I have always this error

error

this is my js:

 import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import {Editor, EditorState} from 'draft-js';
export default class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {editorState: EditorState.createEmpty()};
        this.onChange = (editorState) => this.setState({editorState});
    }
    render() {
        return (
            <Editor editorState={this.state.editorState} onChange={this.onChange} />
        );
    }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
sana
  • 133
  • 8

1 Answers1

0

for react native you need to use react-native-draftjs-render as draft js work for react and not supported for react native

Mohamed Khalil
  • 3,036
  • 1
  • 20
  • 26