react-native-slider icon indicating copy to clipboard operation
react-native-slider copied to clipboard

requireNativeComponent is not a function with react-native-web

Open penx opened this issue 5 years ago • 3 comments
trafficstars

Environment

react-native-web, storybook

Description

"requireNativeComponent is not a function" when using 3.0.0-rc.2 and react-native-web

Reproducible Demo

https://github.com/penx/react-mixer/tree/6126b45efefb9bd4b4e600d9a4e6191616d7a8c3

Steps to recreate:

  • npm init -y
  • npx -p @storybook/cli sb init --type react
  • add react-native-web to dependencies and in storybook webpack alias
  • add import Slider from '@react-native-community/slider'; to a story
TypeError: (0 , _reactNative.requireNativeComponent) is not a function
    at Object../node_modules/@react-native-community/slider/dist/RNCSliderNativeComponent.js (http://localhost:6006/vendors~main.164a2871296ea09f7f00.bundle.js:115:255)

penx avatar May 24 '20 17:05 penx

I'm also running into this problem with a few tests, particularly

react-native-safe-area-context
react-native-calendars
react-native-gesture-handler

I'm thinking this might be more of a react-native-web problem though

arthurpankiewicz avatar Oct 22 '20 08:10 arthurpankiewicz

+1

carltian avatar Sep 16 '21 06:09 carltian

any news on this one? @penx did you resolve it somehow?

younesshakky avatar May 28 '22 21:05 younesshakky

@BartoszKlonowski I believe this specific issue can be closed. I've confirmed this is no longer happening in v4.3.3. To be clear, web isn't functional in the most recent version, you just don't get this specific error.

For those of you that are interested, I'm working on web support here https://github.com/callstack/react-native-slider/pull/462 and as of this point that PR is minimally functional for my use-cases.

jspizziri avatar Dec 15 '22 13:12 jspizziri

Yes, this one can be closed by #462 Thank you, @jspizziri!

BartoszKlonowski avatar Dec 19 '22 11:12 BartoszKlonowski