mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
react-addons-dom-factories (#9780)
**what is the change?:** `grep -r "react-addons-dom-factories" ./src` and the same in `./packages` then `%s /react-addons-dom-factories/react-dom-factories/gc` **why make this change?:** React dom factories were never part of the 'addons' and we want to minimize the whole 'addons' thing, since we are deprecating the `React.addons.*` API. **test plan:** `yarn test` and manually look at the README that was updated. **issue:** https://github.com/facebook/react/issues/9398
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# `react-addons-dom-factories`
|
||||
# `react-dom-factories`
|
||||
|
||||
> Note:
|
||||
> `ReactDOMFactories` is a legacy add-on. Consider using
|
||||
@@ -6,13 +6,13 @@
|
||||
|
||||
Prior to version 16.0.0, React maintained a whitelist of
|
||||
pre-configured DOM factories. These predefined factories have been
|
||||
moved to the `react-addons-dom-factories` library.
|
||||
moved to the `react-dom-factories` library.
|
||||
|
||||
## Example
|
||||
|
||||
```javascript
|
||||
import ReactDOM from 'react-dom';
|
||||
import DOM from 'react-addons-dom-factories';
|
||||
import DOM from 'react-dom-factories';
|
||||
|
||||
const greeting = DOM.div({ className: 'greeting' }, DOM.p(null, 'Hello, world!'));
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ if (__DEV__) {
|
||||
|
||||
// React.DOM factories are deprecated. Wrap these methods so that
|
||||
// invocations of the React.DOM namespace and alert users to switch
|
||||
// to the `react-addons-dom-factories` package.
|
||||
// to the `react-dom-factories` package.
|
||||
React.DOM = {};
|
||||
var warnedForFactories = false;
|
||||
Object.keys(ReactDOMFactories).forEach(function(factory) {
|
||||
@@ -149,9 +149,9 @@ if (__DEV__) {
|
||||
false,
|
||||
'Accessing factories like React.DOM.%s has been deprecated ' +
|
||||
'and will be removed in v16.0+. Use the ' +
|
||||
'react-addons-dom-factories package instead. ' +
|
||||
'react-dom-factories package instead. ' +
|
||||
' Version 1.0 provides a drop-in replacement.' +
|
||||
' For more info, see https://fb.me/react-addons-dom-factories',
|
||||
' For more info, see https://fb.me/react-dom-factories',
|
||||
factory,
|
||||
);
|
||||
warnedForFactories = true;
|
||||
|
||||
Reference in New Issue
Block a user