Skip to main content

Properties

How do I set the default value for a component property?#

Create an object called "defaultProps" where you specify the property name and its default value.
Then, when exporting the component, transfer this object.

const defaultProps = {
propName: 'Default value',
};
...
export default Object.assign(MyComponent, {
defaultProps,
});

How do I group the property descriptions of a component?#

Specify the "category" parameter with the group name you want in the property description.
If the name doesn't already exist, a new group will be created.

const propInfo = {
propName: {
title: "Property Title",
category: "Category Name",
},
};