@draftbit/babel-plugin-inject-jsx-source
v0.1.0
Published
A babel plugin that injects the source information into the attributes of the JSX element. This is to be used in order to find the location of the element in the source code from the DOM tree.
Keywords
Readme
babel-plugin-inject-jsx-source
A babel plugin that injects the source information into the attributes of the JSX element. This is to be used in order to find the location of the element in the source code from the DOM tree.
Uses the className attribute as it is the only attribute that is guarnteed to not be stripped out by
react-native-web or other bundling steps along the way. Encodes special characters with placeholders to make
it reversible. Use getJsxSourceFromClassName to decode the className back to the source information.
Meant to be used with expo apps, but should work with any react project.
