无法在Android手机上使用draft-js运行反应应用程序

时间:2017-09-26 19:57:18

标签: react-native draftjs

我正在使用draft-js在react-app上工作但是当我运行我的应用程序时,我总是有这个错误

error

这是我的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',
  },
});

1 个答案:

答案 0 :(得分:0)

对于本地反应你需要使用react-native-draftjs-render作为草案js起作用做反应而不支持反应原生