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

Fixed the URL link which led users to a HTTP 404. #276

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions react/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# `import {React} from 'Shopify'`

This guide provides a few guidelines on writing sensible React. Many of these rules are enforced by our [shared ESLint configuration](../packages/eslint-plugin-shopify), which makes use of the excellent [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) project.
This guide provides a few guidelines on writing sensible React. Many of these rules are enforced by our [shared ESLint configuration](../packages/eslint-plugin-shopify), which makes use of the excellent [eslint-plugin-react](https://github.com/Shopify/web-configs/tree/main/packages/eslint-plugin) project.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old URL no longer gives a 404 - but it does redirect.

Should we instead change the URL to:

Suggested change
This guide provides a few guidelines on writing sensible React. Many of these rules are enforced by our [shared ESLint configuration](../packages/eslint-plugin-shopify), which makes use of the excellent [eslint-plugin-react](https://github.com/Shopify/web-configs/tree/main/packages/eslint-plugin) project.
This guide provides a few guidelines on writing sensible React. Many of these rules are enforced by our [shared ESLint configuration](../packages/eslint-plugin-shopify), which makes use of the excellent [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) project.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the difference between the 2 repositories?




Expand Down Expand Up @@ -565,26 +565,26 @@ function GoodComponent({disabled = false}) {
}
}
```

- [5.9](#5.9) <a name="5.9"></a> Components should not accept `style` or `className` as props. Prefer props that signal a particular variation on the component over allowing arbitrary customization.

> Why? Allowing custom styles or class names vastly increases the surface area of your component’s API. This makes the component harder to maintain since you must account for every set of class names, style objects, and their interplay with your component’s base styles. Meaningful variations are better suited to maintaining a design system, and make it simpler for consumers to use your component. [This article](https://medium.com/brigade-engineering/don-t-pass-css-classes-between-components-e9f7ab192785#.67kv95pms) provides additional details on why accepting classes or styles is a bad idea.

ESLint rule: [`forbid-component-props`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md)

```js
// bad
function BadComponent({className}) {
return <div className={['my-component', className].filter(Boolean).join(' ')} />;
}

<BadComponent className="my-special-potentially-conflicting-classname" />

// good
function GoodComponent({special}) {
return <div className={['my-component', special && 'my-component--special'].filter(Boolean).join(' ')} />;
}

<GoodComponent special />
```

Expand Down