Cannot render elements with `type` of `text` or `span` using `types`
ngregory-rbi opened this issue · 4 comments
It seems text
and span
elements default to their own render functions, even when overridden with the types
object. Is thus to be expected?
You can implement renderers for specific marks (eg annotated text spans) using the marks
prop, but not the very leaf nodes (pure text). Do you have a use case for customizing the latter?
Eh? More that I am using this in React Native, and renderText
simply outputs a string, so I need to make sure that I always wrap those in a Text
component. It's doable, but the lack of control feels weird to me. I am merely working on the consuming side though. I am not a content editor, so I don't know what processes they have.
Have you tried using @portabletext/react-native? It should use Text
by default
We have our own custom Text
component that we use. Currently, I am using it for the different block
types, so that works so far. I'm not sure though how it will work in different scenarios.