mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
Moved LinkedInput from addons to packages.
This commit is contained in:
+4
-5
@@ -5,14 +5,12 @@
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*
|
||||
* @providesModule LinkedInput
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var React = require('React');
|
||||
var LinkedValueUtils = require('LinkedValueUtils');
|
||||
var React = require('react');
|
||||
var LinkedValueUtils = require('react/lib/LinkedValueUtils');
|
||||
|
||||
class LinkedInput extends React.Component {
|
||||
render() {
|
||||
@@ -21,8 +19,9 @@ class LinkedInput extends React.Component {
|
||||
newProps.checked = LinkedValueUtils.getChecked(this.props);
|
||||
delete newProps.valueLink;
|
||||
delete newProps.checkedLink;
|
||||
return <input {...newProps} />;
|
||||
return React.createElement('input', newProps);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = LinkedInput;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
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.
|
||||
|
||||
|
||||
```
|
||||
var React = require('react');
|
||||
var ReactDOM = require('react-dom');
|
||||
var LinkedInput = require('react-linked-input');
|
||||
|
||||
var link = {value: 'boo', requestChange: function() {}};
|
||||
React.render(<LinkedInput valueLink={link} />, container);
|
||||
```
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "react-linked-input",
|
||||
"version": "1.0.0",
|
||||
"description": "LinkedInput supports the ReactLink semantics",
|
||||
"main": "LinkedInput.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/facebook/react.git"
|
||||
},
|
||||
"keywords": [
|
||||
"react",
|
||||
"linkedinput",
|
||||
"input",
|
||||
"linked",
|
||||
"reactlink"
|
||||
],
|
||||
"author": "",
|
||||
"license": "BSD-3-Clause",
|
||||
"peerDependencies": {
|
||||
"react": "^0.14.7"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user