-
-
Notifications
You must be signed in to change notification settings - Fork 600
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
custom wrapper for elements #429
Comments
@mateusarbex Would be very much appreciated if you provided a minimal description. What I understand is basically having the option to render the default renderer in a custom renderer, is that it? |
Sorry for not providing a minimal description but what I want is a way to use the the parsed html element with a custom wrapper renderer. Since the renderer prop happens before the html is parsed, I can't wrapp the result in a wrapper I designed. For example: I want to wrapp the parsed img inside a TouchableOpacity |
Would that work out? const renderers = {
img: ({ DefaultRenderer, ...props }) => {
return (
<TouchableOpacity onPress={/* do stuff */}>
<DefaultRenderer {...props} />
</TouchableOpacity>
);
},
}; |
Yes, it would work perfectly! |
@mateusarbex Great. I'll design the next foundry release "renderers" prop with this feature in mind. I'm working on it, expect a first pre-release in a few days ;-) |
Thanks! |
That option would be highly appreciated. I would love to have the option to use a custom renderer for elements with certain attributes, and defer to the default rendered if those attributes are not present. |
This feature is available in the foundry pre-release (see #430 for instruction on how to try it out). You can use
|
Closing now since the stable beta which fixes this issue has just been released. |
No description provided.
The text was updated successfully, but these errors were encountered: