React-native-web: Touchable is not working on exporting components.

Created on 19 Jun 2018  路  4Comments  路  Source: necolas/react-native-web

The problem

I am exporting my components to another project and Touchable is not working in react-native-web components. In the project when I am trying to use the components the click event is not working. I imported the components and those has a onClick method.

How to reproduce
Simplified test case:
Create a component a link that project.

Then in your web project link the library and use it.
Expected behavior

That the click event works as expected.
Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.8.4
  • React (version): 16.3.2
  • Browser: 67.0.3396.87

Any idea @necolas ?

Most helpful comment

Thanks for taking the time to answer me. I am just creating a library and then linked and create another app and exporting and using it. I am using React 16.3.2 and React Native version 0.53.3
I was meant to onPress not onClick.

All 4 comments

  1. There is no onClick prop for touchable. Please refer to the docs.
  2. You didn't include a test case link which is required.
  3. There is no React 0.53.3

Thanks for taking the time to answer me. I am just creating a library and then linked and create another app and exporting and using it. I am using React 16.3.2 and React Native version 0.53.3
I was meant to onPress not onClick.

i have the same issue,

i have my components library which are imported into a nextjs project, in this project i am not able to handle onPress events, only into Text components.

Thanks :)

Make sure you're using the latest version of react and react native web. If you still have a problem open a new issue with all the information requested

Was this page helpful?
0 / 5 - 0 ratings

Related issues

EvanBacon picture EvanBacon  路  3Comments

roryabraham picture roryabraham  路  3Comments

bcpugh picture bcpugh  路  3Comments

shirakaba picture shirakaba  路  3Comments

PaulBGD picture PaulBGD  路  4Comments