Gatsby: Using Webcomponents (e.g. lit-element) instead of react

Created on 22 Feb 2019  路  6Comments  路  Source: gatsbyjs/gatsby

Would it be possible to use gatsby with webcomponents (lit-element) instead of react ?

stale? question or discussion

All 6 comments

you won't be able to entirely remove React as we use parts of it to do routing and other optimisations.

You can use gatsby and webcomponents together. React supports it so we do too 馃槃
https://reactjs.org/docs/web-components.html

There are probably better articles on the web

I did not expect to just remove react and substitute it with lit-element. The question was if that is something worth considering as a future feature. I am fairly new to this but as far as I understand using a native standard would be a great fit for gatsby even if react is a the "standard" nowadays. I am sure routing is something you could do without react-router.

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.

Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

Thanks again for being part of the Gatsby community!

You can use React as Container components and for routing combined with your ui components based in web components

You can use lit-element and React together as long as you have support for CustomElements. Essentially you just use the CustomElement in your react application/plugin and lit-element will take care of the rest. there are some issues with synthetic events you need to be aware of and if you want to keep react in sync with lit-elements you will probably need to look at the React Hooks API

You can find a working sample reference here @ https://github.com/dfds/backstage/blob/dfds-web-api/plugins/dfds-web-api/src/components/DfdsWebApiComponentWrapper/DfdsWebApiComponentWrapper.tsx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinhorton picture dustinhorton  路  3Comments

mikestopcontinues picture mikestopcontinues  路  3Comments

Oppenheimer1 picture Oppenheimer1  路  3Comments

theduke picture theduke  路  3Comments

ferMartz picture ferMartz  路  3Comments