Skip to content
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
16 changes: 11 additions & 5 deletions docs/docs/ref-10-glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,20 @@ These are used as properties of other `ReactElement`s to represent children. Eff

You can use React using only `ReactElement`s but to really take advantage of React, you'll want to use `ReactComponent`s to create encapsulations with embedded state.

A `ReactComponent` Class is simply just a JavaScript class (or "constructor function").

A `ReactComponent` Class is simply just a JavaScript class:
```javascript
var MyComponent = React.createClass({
render: function() {
class MyComponent extends React.Component {
render() {
...
}
});
}
```

Or you can define it as a function (but it will be a stateless `ReactComponent`):
```javascript
function MyComponent() {
return ...
}
```

When this constructor is invoked it is expected to return an object with at least a `render` method on it. This object is referred to as a `ReactComponent`.
Expand Down