What is the right way to handle className
when registering components?
I am seeing this in a component that actually supports className
, but I haven’t declared className
as a prop when calling registerComponent
.
What is the right way to handle className
when registering components?
I am seeing this in a component that actually supports className
, but I haven’t declared className
as a prop when calling registerComponent
.
just put the className prop on the components you dont need to register the className prop
function myComponenet ({className}) => (<div className={className}></div>)
It already has a className
prop. Here is the code: https://github.com/nextui-org/nextui/blob/1becf041d836c0c50edeee5a7f2090e00f98668a/packages/react/src/input/input.tsx#L82
Is it possible that the class name is not being directed to the outermost comment on the component? The Plasmic Studio detection looks at the outermost root element for the class that is being injected.
This is important for things like layout styles to apply correctly, but if things are working fine for your requirements, then for now you can ignore it. We are discussing how to provide more escape hatches and configurability around class name props generally.