Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash if TouchableHighlight has a div as a child #2699

Closed
1 task done
MykolaSauliak opened this issue Jul 11, 2024 · 2 comments
Closed
1 task done

Crash if TouchableHighlight has a div as a child #2699

MykolaSauliak opened this issue Jul 11, 2024 · 2 comments
Labels

Comments

@MykolaSauliak
Copy link

MykolaSauliak commented Jul 11, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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
Copy link
Owner

necolas commented Jul 11, 2024

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

@necolas necolas closed this as completed Jul 11, 2024
@MykolaSauliak
Copy link
Author

MykolaSauliak commented Jul 11, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants