Skip to content

Commit

Permalink
Moved LinkedInput from addons to packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
jim committed Feb 26, 2016
1 parent e2866ae commit d997dcc
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

'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() {
Expand All @@ -21,8 +21,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;

10 changes: 10 additions & 0 deletions packages/react-linked-input/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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');
React.render(<LinkedInput valueLink={{value: 'boo', requestChange: function() {}}} />, container);
```
25 changes: 25 additions & 0 deletions packages/react-linked-input/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "react-linked-input",
"version": "0.0.201602251656",
"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"
}
}

0 comments on commit d997dcc

Please sign in to comment.