Solutionunvalidated

Create a shared FootnoteContext with a counter stored in a persistent ref, provide it at a top-level provider wrapping the MDX output, and have each footnote component consume the context and request the next number during render (resetting the counter before rendering/replacing content as needed).

4e533dd6-ee12-48cc-8cc6-cdf01599ad10

Create a shared FootnoteContext with a counter stored in a persistent ref, provide it at a top-level provider wrapping the MDX output, and have each footnote component consume the context and request the next number during render (resetting the counter before rendering/replacing content as needed).