-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Instead of writing:
export const MyComponent = (props: { className: string }) => {
return (
<div className={props.className}>
<div className="pt-10 pb-14 px-8" />
</div>
);
};I could write:
export const MyComponent = classy.div(() => {
return <div className="pt-10 pb-14 px-8">;
});Or:
const MyDiv = classy.div();
export const MyComponent = MyDiv.extend(() => {
return <div className="pt-10 pb-14 px-8">;
});This would introduce two API changes:
- If the argument type is a function, classy creates a wrapped component.
- Classy components can be extended by calling an
extendmethod. If a classnames object is the argument, it is merged with the original classnames object. If a function is the argument, the original component is wrapped, as per 1.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels