Moved LinkedInput from addons to packages.
jim committed
Feb 25, 2016 at 17:00 UTC
8ab15c1d848013738a8f11712a5c1ef2a153bcc3
4 files changed
+40
-5
packages/react-linked-input/LinkedInput.js
renamed
+4
-5
@@ -5,14 +5,12 @@
5
* This source code is licensed under the BSD-style license found in the
6
* LICENSE file in the root directory of this source tree. An additional grant
7
* of patent rights can be found in the PATENTS file in the same directory.
8
- *
9
- * @providesModule LinkedInput
8
*/
9
10
'use strict';
11
14
-var React = require('React');
15
-var LinkedValueUtils = require('LinkedValueUtils');
12
+var React = require('react');
13
+var LinkedValueUtils = require('react/lib/LinkedValueUtils');
14
15
class LinkedInput extends React.Component {
16
render() {
@@ -21,8 +19,9 @@ class LinkedInput extends React.Component {
19
newProps.checked = LinkedValueUtils.getChecked(this.props);
20
delete newProps.valueLink;
21
delete newProps.checkedLink;
24
- return <input {...newProps} />;
22
+ return React.createElement('input', newProps);
23
}
24
}
25
26
module.exports = LinkedInput;
27
+
packages/react-linked-input/README.md
new
+11
@@ -0,0 +1,11 @@
1
+This component supports the ReactLink API (valueLink, etc) for input components. Support for ReactLink on DOM elements will be removed from React. This component may be used as a migration plan (so your code doesn't break in the next version of React) or may be used if you just like the ReactLink data binding semantics. However, this component is not maintained, so use at your own risk.
2
+
3
+
4
+```
5
+var React = require('react');
6
+var ReactDOM = require('react-dom');
7
+var LinkedInput = require('react-linked-input');
8
+
9
+var link = {value: 'boo', requestChange: function() {}};
10
+React.render(<LinkedInput valueLink={link} />, container);
11
+```
packages/react-linked-input/__test__/LinkedInput-test.js
renamed
packages/react-linked-input/package.json
new
+25
@@ -0,0 +1,25 @@
1
+{
2
+ "name": "react-linked-input",
3
+ "version": "1.0.0",
4
+ "description": "LinkedInput supports the ReactLink semantics",
5
+ "main": "LinkedInput.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/facebook/react.git"
12
+ },
13
+ "keywords": [
14
+ "react",
15
+ "linkedinput",
16
+ "input",
17
+ "linked",
18
+ "reactlink"
19
+ ],
20
+ "author": "",
21
+ "license": "BSD-3-Clause",
22
+ "peerDependencies": {
23
+ "react": "^0.14.7"
24
+ }
25
+}