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:
Robbie Antenesse 2016-09-21 18:25:39 -06:00
parent a7068d640a
commit 4521dac524
1 changed files with 2 additions and 17 deletions

View File

@ -11,14 +11,7 @@ export class Dictionary extends React.Component {
name: "New",
description: "A new dictionary.",
createdBy: 'Someone',
words: [{
name: 'word',
pronunciation: 'pronunciation',
partOfSpeech: 'partOfSpeech',
simpleDefinition: 'simpleDefinition',
longDefinition: 'longDefinition',
wordId: 'wordId'
}],
words: [],
nextWordId: 1,
externalID: 0,
allowDuplicates: false,
@ -34,7 +27,7 @@ export class Dictionary extends React.Component {
showWords() {
let words = this.state.words.map((word, index) => {
<Word key={'dictionaryEntry' + index.toString()}
return <Word key={'dictionaryEntry' + index.toString()}
name={word.name}
wordId={word.wordId}
pronunciation={word.pronunciation}
@ -81,14 +74,6 @@ export class Dictionary extends React.Component {
</div>
<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()}
</div>