It looks like what I want to do should be possible, but I don't think I'm getting the syntax quite right. I would like to automatically find and replace special characters like ® with ® and wrap them in tags.
Looking at the video on serializers here https://youtu.be/US6mirW71ac&t=312, it looks like this should be possible with children.replace, but my IDE is not accepting replace on children since that's JSX Elements directly. I do not want to use labels for this because there are already labels in use and since they cannot currently be nested this won't work.
Can you give me a little more information on your code and what it looks like right now, so we're better able to help you out?
What do you mean by that? What are the JSX elements, and what IDE are you using? Are you seeing any error codes or unexpected behaviors related to what you're trying to do?
This error is likely happening because .replace is a method that only works on strings. Because you're passing heading from PrismicRichText as a prop, children is either not a string, or not read as a string, which is what TypeScript is telling you with children is a type 'Element[ ]'. If you want to use .replace for your htmlSerializer, you'd have to make sure of what children is.
Is this your entire serializer just like in the YouTube video, or is this part of a specific slice? If you can show me the rest of your code, or the way that you're going about this, I can try to help you figure it out with or without replace