Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update no-unused-prop-types.md #2273

Merged
merged 1 commit into from Oct 6, 2019
Merged

Update no-unused-prop-types.md #2273

merged 1 commit into from Oct 6, 2019

Conversation

@coryhouse
Copy link
Contributor

@coryhouse coryhouse commented May 12, 2019

Using latest syntax, eliminated SFC since that's a dated term. Fixed grammar.

@@ -86,12 +90,12 @@ AComponent.propTypes = {
bProp: PropTypes.string // bProp is defined but never used
};
```
A suggested fix is to assign a bProp to a variable outside of the SFC.

This comment has been minimized.

@ljharb

ljharb May 12, 2019
Collaborator

i prefer to keep the term SFC while it's still in common usage in the community. Please revert these.

This comment has been minimized.

@coryhouse

coryhouse May 12, 2019
Author Contributor

There's no mention of SFC in the react docs anymore. Or stateless function. https://www.dropbox.com/s/u51xabyw7wfuqqy/Screenshot%202019-05-12%2008.12.19.png?dl=0. And even if one does know the history and what SFC means, the warnings apply to function components with state (via Hooks) too.

This comment has been minimized.

@ljharb

ljharb May 12, 2019
Collaborator

React docs are irrelevant; it’s still a widely used term in the community. A component with a useState hook is still an SFC.

Using Intermediate variables might be desired and unavoidable for more complex props structure.
Like for shape prop types. To avoid false positive in this case make sure `skipShapeProps` is set to `true`.
Using intermediate variables might be desired and unavoidable for more complex props structure.
Like for shape propTypes. To avoid false positive in this case make sure `skipShapeProps` is set to `true`.

This comment has been minimized.

@ljharb

ljharb May 12, 2019
Collaborator

Suggested change
Like for shape propTypes. To avoid false positive in this case make sure `skipShapeProps` is set to `true`.
For example, for shape propTypes, to avoid a false positive, make sure `skipShapeProps` is set to `true`.
@EvHaus EvHaus self-assigned this Jul 25, 2019
@EvHaus
Copy link
Collaborator

@EvHaus EvHaus commented Oct 6, 2019

I've addressed the feedback and rebased against the latest changes in this PR. #2450

Closing this.

@EvHaus EvHaus closed this Oct 6, 2019
@ljharb ljharb reopened this Oct 6, 2019
@ljharb
Copy link
Collaborator

@ljharb ljharb commented Oct 6, 2019

@EvHaus rather than opening another PR, collaborators can force push directly to PR branches.

@ljharb
ljharb approved these changes Oct 6, 2019
@EvHaus
Copy link
Collaborator

@EvHaus EvHaus commented Oct 6, 2019

My bad @ljharb. Good to know for next time. Is this good to merge after CI?

@ljharb ljharb merged commit e911882 into yannickcr:master Oct 6, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.004%) to 97.551%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants