Remove references to createClass in createElement docs (#8064)
Dan Abramov committed
Oct 23, 2016 at 15:48 UTC
156639241e3adf536bf4bbf36d6616c488e12ddd
1 file changed
+6
-5
docs/docs/reference-react.md
+6
-5
@@ -139,12 +139,11 @@ React.createElement(
139
)
140
```
141
142
-Create and return a new React element of the given type. The type argument can be either an
143
-html tag name string (eg. 'div', 'span', etc), or a React class (created via `React.createClass()`).
142
+Create and return a new [React element](/react/docs/rendering-elements.html) of the given type. The type argument can be either a tag name string (such as `'div'` or `'span'`), or a [React component](/react/docs/components-and-props.html) type (a class or a function).
143
145
-Code written with JSX will be converted to use `React.createElement()`. You will not typically invoke `React.createElement()` directly if you are using JSX. See [React Without JSX](/react/docs/react-without-jsx.html) to learn more.
144
+Convenience wrappers around `React.createElement()` for DOM components are provided by `React.DOM`. For example, `React.DOM.a(...)` is a convenience wrapper for `React.createElement('a', ...)`. They are considered legacy, and we encourage you to either use JSX or use `React.createElement()` directly instead.
145
147
-Convenience wrappers around `React.createElement()` for DOM components are provided by `React.DOM`. For example, `React.DOM.a(...)` is a convenience wrapper for `React.createElement('a', ...)`.
146
+Code written with [JSX](/react/docs/introducing-jsx.html) will be converted to use `React.createElement()`. You will not typically invoke `React.createElement()` directly if you are using JSX. See [React Without JSX](/react/docs/react-without-jsx.html) to learn more.
147
148
* * *
149
@@ -178,7 +177,9 @@ This API was introduced as a replacement of the deprecated `React.addons.cloneWi
177
React.createFactory(type)
178
```
179
181
-Return a function that produces React elements of a given type. Like [`React.createElement()`](#createElement), the type argument can be either an html tag name string (eg. 'div', 'span', etc), or a React class.
180
+Return a function that produces React elements of a given type. Like [`React.createElement()`](#createElement), the type argument can be either a tag name string (such as `'div'` or `'span'`), or a [React component](/react/docs/components-and-props.html) type (a class or a function).
181
+
182
+This helper is considered legacy, and we encourage you to either use JSX or use `React.createElement()` directly instead.
183
184
You will not typically invoke `React.createFactory()` directly if you are using JSX. See [React Without JSX](/react/docs/react-without-jsx.html) to learn more.
185