Omnistac / zedux

:zap: A Molecular State Engine for React
https://Omnistac.github.io/zedux/
MIT License
344 stars 7 forks source link

feat(react): get component name via forbidden react internals #73

Closed bowheart closed 9 months ago

bowheart commented 1 year ago

Description

Every couple weeks, I get the strongest urge to make this change. I know it's mega bad practice and I don't think I can bring myself to actually merge this. But I'm gonna leave this here. Just so I can stop thinking of implementing it.

This uses the forbidden React secret internals object to access the currently-rendering component so we can get its displayName for the atom graph without using incredibly slow, hacky, brittle stack trace parsing.