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

Very small changes #9457

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 4 additions & 0 deletions docs/tutorial/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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```;
Copy link
Collaborator

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).


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.
Expand All @@ -98,6 +100,8 @@ return React.createElement('div', {className: 'shopping-list'},
);
```

https://facebook.github.io/react/docs/react-api.html#createelement
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Author

Choose a reason for hiding this comment

The 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)...

Copy link
Author

Choose a reason for hiding this comment

The 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.
Expand Down