instacart / instacart/Snacks

FormComponent should use defaultProps

Open
#297 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
82
Forks
36
PR merge metrics
No merged PRs in 30d

Description

If an `id` prop is not passed to the `FormComponent` component, it generates a unique id for labels lower down in the component tree. This is great in some ways, but it has a couple issues:
- It's not clear in the documentation that this will happen, since it's not using `defaultProps`
- This causes issues with snapshot tests for users of the library, since this data is randomized for each test run

Issue 1 has an obvious fix. Issue 2 could just be a requirement for users to supply an id prop during tests.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.