3 ms·
> But that doesn’t exist in the web components world (at least not yet). When you use <my-button> in a React component, you don’t have to explicitly import my-b
by DanielHB 2y ago
> But that doesn’t exist in the web components world (at least not yet). When you use <my-button> in a React component, you don’t have to explicitly import my-button from anywhere inside that file.
Technically you can just export a string with the name of your web component:
export const MyButton = 'my-button'
import MyButton from './MyButton'
...
return <MyButton />
But you do have to make sure there is no name clash. And since this is more of a convention any web components libs you pick up will probably not do this.