expo icon indicating copy to clipboard operation
expo copied to clipboard

Import React into BlurView.web.tsx

Open Saikedo opened this issue 1 year ago • 1 comments

If React is not imported, react-native-web fails on web with an error(At least it does when using this inside of a bit component).

ReferenceError: React is not defined at eval (BlurView.web.js:57:3) ...

Why

The component fails to run on react-native-web if React is not imported. I did not test to see if it fails in pure react-native-web, but our company is leveraging expo-blur inside of bit.dev React Native environment and web fails unless React is included.

How

To test the fix, I just modified the code inside node_modules.

Saikedo avatar Jun 28 '24 16:06 Saikedo

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing changelog entries

Your changes should be noted in the changelog. Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against 42a6665e000d21715aeefb58d2ff6a9470038798

expo-bot avatar Jun 28 '24 16:06 expo-bot

Hi, I created a new app with npx create-expo-app, insterted a BlurView, started it on web and everything seemed to work correctly without your fix. I don't really understand the circumstances when the error is supposed to show up, can you provide an example?

behenate avatar Jul 18 '24 10:07 behenate

@behenate I am pretty sure it will work as expected inside of an expo app. I am trying to use this inside of a bit project (Ecosystem for creating reusable components). They do have support for react-native-web which I assume is silimar to what Expo is doing but I guess some things work different.

Cant really provide an example of bit project because it will be too messy but it is failing on just the basic example from expos website.

Saikedo avatar Jul 18 '24 15:07 Saikedo