Error with ListItem and react-native-web
See original GitHub issueAfter the upgrade of RNE from 2.2.something to 2.3.2 I’m getting the following error in when trying to render a ListItem in the browser (using expo and react-native-web):
TypeError: react_native_web_dist_exports_Platform__WEBPACK_IMPORTED_MODULE_10__.default.select(...) is undefined
Looking at the source code I see that the following call in ListItem:
const renderIcon = (content, theme) =>
renderNode(Icon, content, {
color: Platform.select(theme.colors.platform).grey,
size: 24,
});
So it looks like Platform
is not resolved in the native-web context. It does work on my Android though.
Here’s a Snack that reproduces the problem: https://snack.expo.io/rGHEaYbtn
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
react-naive-elements ListItem causing below listed Errors in ...
Looks to me as if there are no colours defined when the platform is web. I am getting the same issue too after...
Read more >ListItem pad prop not working for web · Issue #2230 - GitHub
I am developing a react-native (version 0.61.5) Expo-App with a ListItem (react-native-elements version 1.2.7). ... The problem is, that the pad ...
Read more >Troubleshooting | React Native Elements
This error occurs when trying to import a component that doesn't exist. ... import { Listitem } from 'react-native-elements' // Correct
Read more >Error Boundaries - React
Error boundaries are React components that catch JavaScript errors anywhere in their child component tree, log those errors, and display a fallback UI...
Read more >Strict Mode - React
When strict mode is enabled, React compiles a list of all class components using ... Since object refs were largely added as a...
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 FreeTop 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
Top GitHub Comments
The snack demo is working perfectly.
If you are talking about this error
Then this got fixed and will be released in
v3
, which is about to release very soon.Hi @baileytincher we have released
v3
in alpha, I hope this will help. Happy Hacking 😃