Closed ithustle closed 5 years ago
Did you define the setTab
function you have there?
Yep. Something like:
setTab = selectedTab => { console.log(selectedTab) this.setState({ selectedTab: 1 }); }
Can you show the whole example or recreate part of it on https://snack.expo.io that reproduces this?
Oh damn! Shame on me... I've put setTab
function inside render()
... My bad. Sorry. It's solved. Thanks for your time :)
All good! Glad you got it sorted out
One more thing:
How can I avoid Warning: Encountered two children with the same key,
null. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
using components
on items
instead text
?
In your items array, just add a key on to the items.
<FontAwesome name={"home"} size={24} style={[styles.icons, { color: "#fff" }]} key="home" />
You rock!
I'm facing this error.
My code:
Any help?