News for hackers. Stuff that matters.
Re:Show HN: Paste React components into any website by bdorn on Tuesday September 27, 2022 @08:06AM (#32994299)
I'm sorry, but what problem does this solve? Seems like this makes the developer experience worse in every way.
Re:Show HN: Paste React components into any website by jimhi on Tuesday September 27, 2022 @08:52AM (#32994665)
You can see many examples if you google - "How do I put react into my " Github page/Shopify/Wordpress etc.

Many developers inherit or prefer a plain page and just want to use a cool open source react component real quick like adding a slick calculator to their existing webpage.

Re:Show HN: Paste React components into any website by bdorn on Tuesday September 27, 2022 @09:09AM (#32994790)
I'm not following - even manually inserting script tags to mount the component is better than relying on another site like this to bundle it.
Re:Show HN: Paste React components into any website by jimhi on Tuesday September 27, 2022 @09:11AM (#32994803)
As said below, most common react libraries will fail if you try to just use ReactDOM. Mounting has many issues if you try it for more than the basic hello world.

Not to mention you can use multiple different versions of react with this.

Just as an example, I was trying to add this simple PinField to my wordpress page and it will break if you try to mount: https://www.npmjs.com/package/react-pin-field

Re:Show HN: Paste React components into any website by sibit on Tuesday September 27, 2022 @09:17AM (#32994851)
> most common react libraries will fail if you try to just use ReactDOM

I'd think that would be a pretty big sign that React might not be the right tool for the job. I'm all for building custom hammers but sometimes it might just be better to just grab a screwdriver.

Re:Show HN: Paste React components into any website by jimhi on Tuesday September 27, 2022 @09:27AM (#32994962)
Also, you can just download the bundle if you want to stop using the site to host it. Personally I make enough edits I like to keep it up.
Re:Show HN: Paste React components into any website by sibit on Tuesday September 27, 2022 @03:38PM (#33000085)
My comment wasn't a critique on your product. I can totally see how this could be handy and I'll keep it bookmarked. I was mostly critiquing that web devs nowadays always seem to try and reach out for some React package whenever they hit any sort of problem. I can see that the React packages are mandatory, any plans to support other frameworks?
Re:Show HN: Paste React components into any website by jimhi on Tuesday September 27, 2022 @03:45PM (#33000199)
Vue would be pretty easy. From personal experience it’s mostly react that’s has all these open source things someone might want. Was there one you were thinking of?
Re:Show HN: Paste React components into any website by kclay on Tuesday September 27, 2022 @09:43AM (#32995131)
Funny enough I ran into this exact use case recently. We have a marketing site for a client done with webflow..But we needed to add a third party widget that only had an react library. So I ended up creating a CRA project so that I could include the bundled file and render the component as needed using the same setup (it was a modal + some purchase logic). Added some bare js hooks to trigger some of the logic via a button press. Worked well actually
Re:Show HN: Paste React components into any website by bdorn on Tuesday September 27, 2022 @09:52AM (#32995225)
That works, I was more responding to using this random site instead of just CRA locally. Just seems odd.