[1.0.0-beta] Button icons do not work: Objects are not valid as a React child (found: object with keys {name, type})
See original GitHub issueHello, I am having a problem with button icons, more specifically: I have added a button, and later on tried adding an icon to the button as described in the docs
<Button
text={'Messenger'}
icon={{name: 'fa-commenting-o', type: 'font-awesome' }}
onPress={() => navigate('Messneger')} />
<Button text='YouTube 📺' onPress={() => navigate('YouTube')} />
Unfortunately. the icon doesn’t appear and instead I am getting this red screen:
I am using: CRNA with “react-native-elements”: “^1.0.0-beta”, and, “@expo/vector-icons”: “^6.2.2”,
Here’s a reproduction of the problem https://snack.expo.io/H1DKeg6BG
Thanks.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Understanding the "Objects are not valid as a react child" Error ...
The "Objects are not valid as a React child" error happens when trying to render a collection of data by mistakenly returning the...
Read more >Invariant Violation: Objects are not valid as a React child
This error usually happens because a function involved in dispatching an event has been given an unexpected object type (i.e passing an object...
Read more >Objects are not valid as a React child React error | bobbyhadz
The React.js error "Objects are not valid as a React child" occurs when we try to directly render an object or an array...
Read more >Resolving Error: "Objects are not valid as a React child"
As the error message states, React cannot render objects as children directly. If you are seeing this error, there is a good chance...
Read more >Design Patterns with React Easy State | by Bertalan Miklos
React Easy State is a transparent reactive state management library with two functions and two accompanying rules. Always wrap your components with view()...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @hilalh, the
Button
documentation is not updated yet, but will be soon.You must pass a component to the
icon
props. You can use theIcon
component from RNE for example, by doing this:Thanks!