diff --git a/src/components/Dictionary.jsx b/src/components/Dictionary.jsx
index a3b8215..4165e89 100644
--- a/src/components/Dictionary.jsx
+++ b/src/components/Dictionary.jsx
@@ -8,6 +8,7 @@ export class Dictionary extends React.Component {
super(props);
this.state = {
+ dictionary: this.props.reference,
name: this.props.reference.name,
description: this.props.reference.description,
createdBy: this.props.reference.createdBy,
@@ -56,17 +57,19 @@ export class Dictionary extends React.Component {
}, () => console.log(this.state.words));
}
- changeTestWord() {
- this.setState(
- words[0].name: 'cool'
- );
+ changeNameAgain() {
+ let updateDictionary = this.state.dictionary;
+ updateDictionary.name = 'something else again'
+ this.setState({
+ dictionary: updateDictionary
+ })
}
render() {
return (
- {this.state.name}
+ {this.state.dictionary.name}
@@ -84,6 +87,10 @@ export class Dictionary extends React.Component {
action={() => this.addTestWord()}
label='Add a Test Word' />
+