JetBrains/svg-mixer

Alternate browser+server API

wmertens opened this issue · 4 comments

Would it be possible to use the loader and svg-baker for something like the below?

<SymbolProvider>
    <App/>    // Use with e.g. <UseSymbol symbol={symbol}/>
    <svg>[...all currently-used symbols]</svg> // Gets added automatically, or maybe with another component
</SymbolProvider>

SymbolProvider would add context so that every <UseSymbol/> can register the id as being used.

This way, it also works with server-side rendering, even if multiple render simultaneously. The in-use symbols are all known by the time the svg with symbols renders.

Is this something you talking about in this issue JetBrains/svg-sprite-loader#45?

Right, I forgot about that one. I took a quick look and it seems to me that I need to make a custom runtime that doesn't do anything, and then just use the objects the loader returns?

Yes, but I don't understand your case entirely, could you describe by code what such runtime should do?