mac-s-g / react-json-view

JSON viewer for react
https://mac-s-g.github.io/react-json-view/demo/dist/
MIT License
3.45k stars 494 forks source link

Object(...) is not a function error when call onEdit (version 1.21.3) #379

Open gatsoevaulyana opened 3 years ago

gatsoevaulyana commented 3 years ago

I copied this component from demo source. An error occurs after click on the Edit field button

<ReactJson name={false} collapsed={collapsed} style={style} theme={theme} src={src} collapseStringsAfterLength={collapseStringsAfter} onEdit={ onEdit ? e => { console.log(e); this.setState({ src: e.updated_src }); } : false } onDelete={ onDelete ? e => { console.log(e); this.setState({ src: e.updated_src }); } : false } onAdd={ onAdd ? e => { console.log(e); this.setState({ src: e.updated_src }); } : false } displayObjectSize={displayObjectSize} enableClipboard={enableClipboard} indentWidth={indentWidth} displayDataTypes={displayDataTypes} iconStyle={iconStyle} />