algolia/react-element-to-jsx-string

production jsx string not correct

rimsila opened this issue · 5 comments

in dev mode  <Pricing2 />
prod mode:  <i />

after build it remain only i

Did you find a solution for that? This is happening to me in production but I don't what it may be.

Did you find a solution for that? This is happening to me in production but I don't what it may be.

I want to use it in react library for demo by showing jsx usage and copy to clipboard but it working only in development. I hope I can use it in production build also it save my time on re-write jsx code again thanks you
https://components-next.netlify.app/components/display/button

tu4mo commented

Try using displayName for components or disable function name mangling in your minifier.

Try using displayName for components or disable function name mangling in your minifier.

Thanks you It working now after displayName to component

Screen Shot 2021-12-14 at 5 12 29 PM

@rimsila if you are using react-scripts for building, adding --profile to react-scripts build will keep the class names and also functions names for production profiling. I tried it and it works for me 😁