question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error with ListItem and react-native-web

See original GitHub issue

After 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:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
pranshuchittoracommented, Oct 11, 2020

The snack demo is working perfectly.

Screenshot from 2020-10-12 02-59-57

If you are talking about this error

Screenshot from 2020-10-12 03-00-07

Then this got fixed and will be released in v3, which is about to release very soon.

1reaction
pranshuchittoracommented, Oct 17, 2020

Is there a short-term workaround or can a v3 alpha version be uploaded to npm? @pranshuchittora

Hi @baileytincher we have released v3 in alpha, I hope this will help. Happy Hacking 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found