wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.45k stars 706 forks source link

Object is not a function in HighlighterOverlayView.js #2407

Closed localjo closed 1 year ago

localjo commented 1 year ago

Description

I am unable to load apps using react-native-ui-lib in the browser, because of an error in HighlighterOverlayView.js

Related to

Steps to reproduce

  1. Install expo-starter: https://github.com/kanzitelli/expo-starter
  2. Apply fix for other issue: https://github.com/kanzitelli/expo-starter/issues/31 (note: this is not related, but needed to reproduce)
  3. Run expo start --web
  4. Try to load the app the browser

Expected behavior

The app should load with no errors.

Actual behavior

The app doesn't load and I get this console error in the browser:

Uncaught TypeError: Object(...) is not a function
    at ./node_modules/react-native-ui-lib/lib/components/HighlighterOverlayView.js (HighlighterOverlayView.js:3:1)

More Info

This may be related to https://github.com/wix/react-native-ui-lib/issues/2380 and https://github.com/wix/react-native-ui-lib/issues/2204

As a workaround, I am downgrading to v6.4.0 because it seemed that this commit may have introduced the issue: https://github.com/wix/react-native-ui-lib/commit/a06be426619bd272a8649d4400d5b389860f2f70 (note: that's just a guess based on what I saw in the commit history, but I didn't verify that that's where the bug was introduced).

Screenshots/Video

Screenshot 2023-01-05 at 12 16 22 PM

Environment

Affected platforms

localjo commented 1 year ago

After further investigation, it seems that this was introduced in v6.13.0, with this commit: https://github.com/wix/react-native-ui-lib/commit/2f023e3645efdcd8135be00c03039239862f5e7b

So I'm able to use v6.12.2 without this issue. But there are other issues in v6.12.2 that have been fixed in newer versions, so this workaround isn't enough for me to get my app working.

localjo commented 1 year ago

Apologies. I just upgraded react-native-ui-lib to v6.27.3 and this problem has been fixed.