You need to return the value after you map it to the array, you idiot!
Now I need to go back and abstract the word data so it gets passed as a reference to the Word component instead of as straight data so it'll be easier to save/load.
This commit is contained in:
parent
a7068d640a
commit
4521dac524
|
@ -11,14 +11,7 @@ export class Dictionary extends React.Component {
|
||||||
name: "New",
|
name: "New",
|
||||||
description: "A new dictionary.",
|
description: "A new dictionary.",
|
||||||
createdBy: 'Someone',
|
createdBy: 'Someone',
|
||||||
words: [{
|
words: [],
|
||||||
name: 'word',
|
|
||||||
pronunciation: 'pronunciation',
|
|
||||||
partOfSpeech: 'partOfSpeech',
|
|
||||||
simpleDefinition: 'simpleDefinition',
|
|
||||||
longDefinition: 'longDefinition',
|
|
||||||
wordId: 'wordId'
|
|
||||||
}],
|
|
||||||
nextWordId: 1,
|
nextWordId: 1,
|
||||||
externalID: 0,
|
externalID: 0,
|
||||||
allowDuplicates: false,
|
allowDuplicates: false,
|
||||||
|
@ -34,7 +27,7 @@ export class Dictionary extends React.Component {
|
||||||
|
|
||||||
showWords() {
|
showWords() {
|
||||||
let words = this.state.words.map((word, index) => {
|
let words = this.state.words.map((word, index) => {
|
||||||
<Word key={'dictionaryEntry' + index.toString()}
|
return <Word key={'dictionaryEntry' + index.toString()}
|
||||||
name={word.name}
|
name={word.name}
|
||||||
wordId={word.wordId}
|
wordId={word.wordId}
|
||||||
pronunciation={word.pronunciation}
|
pronunciation={word.pronunciation}
|
||||||
|
@ -81,14 +74,6 @@ export class Dictionary extends React.Component {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="theDictionary">
|
<div id="theDictionary">
|
||||||
<Word
|
|
||||||
name='{word.name}'
|
|
||||||
wordId='{word.wordId}'
|
|
||||||
pronunciation='{word.pronunciation}'
|
|
||||||
partOfSpeech='{word.partOfSpeech}'
|
|
||||||
simpleDefinition='{word.simpleDefinition}'
|
|
||||||
longDefinition='{word.longDefinition}'
|
|
||||||
initialPosition='{index}' />
|
|
||||||
{this.showWords()}
|
{this.showWords()}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue