We are currently using ReactDOM.renderToStaticMarkup
to render a tooltip within highcharts
.
const chartOptions: Options = {
chart: { height },
tooltip: {
...,
formatter: function () {
return ReactDOMServer.renderToStaticMarkup(
<OurComponent/>
)
}
},
However in React 18, the renderToStaticMarkup
API was removed when React is running in the browser and there is no way that I'm aware of on the client-side to retrieve the static HTML that would be generated from the React component.
We do not have a node server so cannot migrate to SSR
to accomplish this.
Highcharts is framework-agnostic so they only accept raw HTML.
Is anyone aware of a way to accomplish this?