Actualize
Actualize
TTCTheo's Typesafe Cult
Created by Actualize on 6/11/2024 in #questions
Create an embedded widget out of react component used in Next.js project
I've built an application in Next.js with some components that need to run as "widgets" or "web components" on third-party websites. These components are also used in my application for demo purposes. It would be ideal to use the same components to create widgets without rewriting external libraries like react-hot-toast. I managed to solve this by using Webpack to bundle the component along with all its dependencies (sub-components, Tailwind CSS, etc.), including React and ReactDOM, so that the client can run the components. However, I'm wondering if there's a simpler way to achieve this.
1 replies