diff --git a/src/JSONEditor.js b/src/JSONEditor.js index 997e02b..650358f 100644 --- a/src/JSONEditor.js +++ b/src/JSONEditor.js @@ -19,7 +19,6 @@ export default class JSONEditor extends Component { render () { return h(TreeMode, { - ref: 'tree-mode', options: this.state.options, data: this.state.data }, []) @@ -31,16 +30,7 @@ export default class JSONEditor extends Component { * @param {SetOptions} [options] */ set (json, options = {}) { - if (this.refs['tree-mode']) { - this.refs['tree-mode'].set(json, options) - } - else { - // not yet rendered - this.setState({ - data: json, - options - }) - } + // TODO: set state via redux action } /** @@ -48,12 +38,6 @@ export default class JSONEditor extends Component { * @returns {Object | Array | string | number | boolean | null} json */ get () { - if (this.refs['tree-mode']) { - return this.refs['tree-mode'].get() - } - else { - // not yet rendered - return this.state.data - } + // TODO: get state from redux store } } \ No newline at end of file diff --git a/src/TreeMode.js b/src/TreeMode.js index bc2b3aa..cb37f72 100644 --- a/src/TreeMode.js +++ b/src/TreeMode.js @@ -298,7 +298,8 @@ export default class TreeMode extends Component { return dataToJson(this.state.data) } - // TODO: create getText and setText + // TODO: implement expand + // TODO: implement getText and setText /** * Default function to determine whether or not to expand a node initially