Skip to content

Commit 0eb2cbf

Browse files
Add Adding a new prop to contributing
1 parent c0b7c62 commit 0eb2cbf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

CONTRIBUTING.md

+6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ First, on behalf of the core maintainers, I'd like to thank you for wanting to c
99
1. `npm start` to start [Storybook](https://storybook.js.org/). View stories at [http://localhost:9001](http://localhost:9001). Modify the source code to update component stories in the sidebar.
1010
1. Read the [Codebase Overview](docs/codebase-overview.md) to learn concepts and best practices for the codebase and to confirm contribution is within project scope.
1111

12+
## Adding a new prop
13+
1. This library is open to `data`, `ref`, `style`, and `className` on any element within reason, but especially open to it for the “primary part of a component” such as form elements such as `input` or a clickable elements such as `button`, since these are often used for testing purposes or form submission. This is probably a better way to write unit tests, anyway, since SLDS class changes are not considered breaking changes.
14+
1. `ref` callbacks should be within an `object` named refs with typically a key name of the HTML tag name. These should be tested with a Mocha callback.
15+
1. `style` props should be `style[SUFFIX]` and be tested with a Jest DOM snapshot by adding a Story to Storybook.
16+
1. `className` props should be `className[SUFFIX]` and be `PropTypes.oneOfType([PropTypes.array, PropTypes.object, PropTypes.string])` and be tested with a Jest DOM snapshot by adding a Story to Storybook.
17+
1218
## How to add a new component
1319

1420
1. Create a new issue or add to an existing one.

0 commit comments

Comments
 (0)