Hoistable SVG Defs, Take Two: Impersonating the DOM
Deduplicating SVG definitions in React by portaling them into a plain object that impersonates a DOM node, the trick behind React Aria's Collections.
I’m Jules. I’m a software engineer with a background in geoscience engineering.
I’m passionate about on making ideas, systems and processes more understandable.
I believe that maps, charts, and diagrams are a great way to do that.
I’m passionate about the World Wide web, its reach, its usefulness. I believe that it is a great place to build and share useful tools for understanding.
At the moment, I’m working on making geotechnical data more useful at
Bedrock.engineer.
You can find me on the web on Twitter.
Deduplicating SVG definitions in React by portaling them into a plain object that impersonates a DOM node, the trick behind React Aria's Collections.
Colocating SVG definitions with the components that use them, using portals and context. An overengineered but instructive exercise.
Understanding how parent and owner components affect context updates can help you write more performant context providers
An in-depth look at what ReactDOM.flushSync does and what it’s good for.
Being aware of the distinction between parent and owner components can help you isolate updates and improve rendering performance.