Skip to content

Instantly share code, notes, and snippets.

@rojasmi1
Created May 9, 2017 23:35
Show Gist options
  • Save rojasmi1/f1267c99edcc0771d81fdbd14e64cb86 to your computer and use it in GitHub Desktop.
Save rojasmi1/f1267c99edcc0771d81fdbd14e64cb86 to your computer and use it in GitHub Desktop.
React state with array
state = {
devTredns : [
{name: 'es6': value: 8},
{name: 'ionic': value: 7},
{name: 'react': value: 10},
{name: 'reactnative': value: 10}
]
}
myHandler = () => {
// Recorrer el arreglo del estado
for(const trend of this.state.devTrends) {
// Imprimir el nombre de cada trend
console.log(trend.name)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment