-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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
Very small changes #9457
Very small changes #9457
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,6 +85,8 @@ class ShoppingList extends React.Component { | |
// Example usage: <ShoppingList name="Mark" /> | ||
``` | ||
|
||
> You can import ```{ Component } from react``` and you can use only ```Component``` instead ```React.Component```; | ||
|
||
We'll get to the funny XML-like tags in a second. Your components tell React what you want to render – then React will efficiently update and render just the right components when your data changes. | ||
|
||
Here, ShoppingList is a **React component class**, or **React component type**. A component takes in parameters, called `props`, and returns a hierarchy of views to display via the `render` method. | ||
|
@@ -98,6 +100,8 @@ return React.createElement('div', {className: 'shopping-list'}, | |
); | ||
``` | ||
|
||
https://facebook.github.io/react/docs/react-api.html#createelement | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just placing a link like this is not very helpful. Is there a better way we could do it? I would also prefer that we do this consistently for all API rather than in one place. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I will close this pull request, but I will open another, better request. Thanks for activity, @gaearon I'm big your fan (I'm 11 years old and now I learning to develop with react)... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
You can put any JavaScript expression within braces inside JSX. Each React element is a real JavaScript object that you can store in a variable or pass around your program. | ||
|
||
The `ShoppingList` component only renders built-in DOM components, but you can compose custom React components just as easily, by writing `<ShoppingList />`. Each component is encapsulated so it can operate independently, which allows you to build complex UIs out of simple components. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is important in this tutorial (and it's not relevant for most people who would follow along on CodePen).