Open HosseinAgha opened 1 year ago
I agree that the built-in useId
is a better option going forward. I will migrate to it and publish a major version when I will have more free time in the upcoming months.
In the meantime, you can use a provider (see SSR example) to generate correct IDs during SSR.
I've already cloned the plugin and changed everything to useId(), happy to contribute if you are OK.
Thanks, PRs are welcome
This package is elegant solution to long standing problem, thank you @laleksiunas ! 👍
I'd be very interested in built-in useId-based id generator and noticed that @HosseinAgha has been working on this. Just wondering if suitability of this work to extend babel-plugin-react-inline-svg-unique-id
package could be reviewed in the form of a PR?
I'd see that useId
could be set as id generation hook babel-plugin-react-inline-svg-unique-id
by configuration property to maintain backward compatibility.
Looks like using React's useId is a more consistent solution for this library. It is isomorphic and covers all SSR and hydration edge cases.