Created
May 9, 2017 23:35
-
-
Save rojasmi1/f1267c99edcc0771d81fdbd14e64cb86 to your computer and use it in GitHub Desktop.
React state with array
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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