Use in React
React 19 uses the components as they are, with no wrapper: every gw- element is a native custom element.
Types
Load the React types once, and JSX checks every gw- element's properties and events:
env.d.ts
import '@greenwolf/ui/react'Values and events
- React 19 sets a property when the element defines one, so objects and arrays reach the component as they are.
- Listen to a component's events with
onand their exact name:ongw-change={…}. - Import each component in the app's entry, before the first render, so its properties exist when React sets them.
Example.tsx
<gw-switch
checked={notify}
ongw-change={(e) => setNotify(e.target.checked)}
/>