I use kramdown and katex in rails on the server to pre-process math and markdown in comments, articles etc from the DB into HTML. However, I'd like some of the elements produced to behave as react components (eg replacing some a tags with react-router links etc)..
Based on the description of React.renderToString() it sounds like I could annotate the HTML I produce to have the appropriate attributes and then use hydrate to turn them into full react nodes.
Is this possible? If so where do I find a reference for what attributes I need to add to turn a standard HTML tag into a hydratable react components?
Or am I going about this entirely the wrong way?