-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the issue
I might be misunderstanding how the react-native-web package is meant to work. So far, it’s been great for rendering my react-native UI library in a Storybook web app, simply by aliasing react-native to react-native-web.
That worked fine until I needed to import InputAccessoryView. Importing this component throws an error:
The requested module ... does not provide an export named 'InputAccessoryView'
What’s confusing is that react-native-web actually does include an InputAccessoryView module, it just isn’t exported from the package’s entry file. I was able to work around this by applying a pnpm patch and adding the following line to dist/index.js in the react-native-web package:
export { default as InputAccessoryView } from './exports/InputAccessoryView';Is there a configuration step I’m missing here? What's the intended setup?
Thanks in advance!
Expected behavior
Expected behaviour is for RNW shim to load and no error is thrown.
Steps to reproduce
import { InputAccessoryView } from 'react-native' // This is aliased to `react-native-web`Above line throws error
Test case
https://codesandbox.io/p/devbox/react-native-web-test-7zgmfn
Additional comments
Error is thrown only when importing & using `InputAccessoryView` in `MyComponent.tsx`. Check the browser inspector for error.