necolas / react-native-web

Cross-platform React UI packages
https://necolas.github.io/react-native-web
MIT License
21.68k stars 1.79k forks source link

Crash if TouchableHighlight has a div as a child #2699

Closed MykolaSauliak closed 4 months ago

MykolaSauliak commented 4 months ago

Is there an existing issue for this?

Describe the issue

react div’s style prop couldn’t be an array, but react-native-web TouchableHighlight modifies styles and makes it as array (via cloneElement) - github. App crashes in such case on web.

Expected behavior

TouchableHighlight could be used with div and other elements as children on web

Steps to reproduce

could be verified with simple example component - TouchableHighlight + div as a child TouchableHighlight with react-native-web View component is ok.

Test case

https://codesandbox.io/s/react-native-web-forked-3w4lg9?file=/src/App.js

Additional comments

No response

necolas commented 4 months ago

You can't use div in React Native. Only nest other React Native elements in touchables.

MykolaSauliak commented 4 months ago

You can't use div in React Native. Only nest other React Native elements in touchables.

what about other libraries. react-spinners, for example, it could be used on web. it's only about web part, not mobile