Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As for #169 here is my implementation of
React.createElement
wrapper that integrates cavy at jsx level.It adds a
cavyCreateElemement
function that is a replacement forReact.createElement
, auto wraps function component and add component refs intotestHookStore
.The
testHookStore
must be set at startup in the index.test.js together with acavyIdPropName
that let you configure how cavy takes identifier from props.It uses @wordpress/babel-plugin-import-jsx-pragma and @babel/plugin-transform-react-jsx to globally replace JSX transpilaton.
I'm experiencing some problem with the metro bundler so I have created a repo to show it react-native-custom-jsx. If you look at build/index.metro.js you can see that there are some
that should not be there, while somewhere else the code is transpiled correctly to
The import cause rn to crash at startup.
I'm investigating, I don't know if someone in the cavy team with a better knowledge of babel/metro can help me.
Thank you for your great job, I'm waiting for your comments and ready to answer your questions.
I'll eventually update docs and types if the feature will be merged.