React-native-testing-library: How to trigger View onLayout event

Created on 29 Nov 2019  路  3Comments  路  Source: callstack/react-native-testing-library

I dont know if it is a bug or not, But I have a onLayout event on a screen that is setting some value in the store. When I first render the view with the render function, the onLayout event is not triggering.

I tried to call a custom event onLayout but is not working either. Any suggestions

question

Most helpful comment

@thymikee please dont close the issue, any help with this. Ok I mock it, but how do I trigger it

All 3 comments

Since you're not in a native environment, the onLayout is not triggering, because there's no layout phase. You'll need to mock it

@thymikee please dont close the issue, any help with this. Ok I mock it, but how do I trigger it

Was this page helpful?
0 / 5 - 0 ratings