solid-styled-components
solid-styled-components copied to clipboard
Don't map props to HTML attributes by default
Hi,
When using styled, the props passed to the component are added to the HTML element as attributes.
For instance, the following component:
type AppProps = {
foo: boolean;
bar: number;
};
const App: Component<AppProps> = styled.main``;
const root = document.getElementById('root');
render(() => <App foo={true} bar={42} />, root!);
Will result in the following DOM:

Here is the code of a simple repro case.
It might be related to #6.
Isn't this solved by using the shouldForwardProp helper?
Docs: https://github.com/solidjs/solid-styled-components#shouldforwardprop