Skip to content

Commit

Permalink
Upd to React 0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
rkit committed Oct 29, 2015
1 parent ee9dada commit 0b30d63
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 22 deletions.
4 changes: 2 additions & 2 deletions examples/src/components/Tags.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react';
import React, { Component } from 'react';
import Select2 from '../../../src/components/Select2';
import '../../../src/css/select2.css';

export default class Tags extends React.Component {
export default class Tags extends Component {
render() {
return (
<div>
Expand Down
3 changes: 2 additions & 1 deletion examples/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';
import { render } from 'react-dom';
import Tags from './components/Tags';

React.render(
render(
<Tags />,
document.getElementById('app')
);
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-select2-wrapper",
"version": "0.0.5",
"version": "0.0.6",
"description": "React component for Select2",
"main": "lib/components/Select2.js",
"scripts": {
Expand All @@ -23,14 +23,15 @@
"input"
],
"dependencies": {
"react": "^0.13.3",
"select2": "^4.0.0",
"jquery": "^2.1.4"
"jquery": "^2.1.4",
"react": "^0.14.0",
"react-dom": "^0.14.1",
"select2": "^4.0.0"
},
"devDependencies": {
"babel": "^5.8.9",
"babel-core": "^5.4.7",
"babel-eslint": "^4.0.5",
"babel": "^5.8.29",
"babel-core": "^5.8.29",
"babel-eslint": "^4.1.1",
"babel-loader": "^5.3.2",
"css-loader": "^0.15.4",
"eslint": "^1.0.0",
Expand Down
25 changes: 13 additions & 12 deletions src/components/Select2.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React from 'react';
import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
import 'select2';

export default class Select2 extends React.Component {
export default class Select2 extends Component {
static propTypes = {
data: React.PropTypes.array,
events: React.PropTypes.array,
options: React.PropTypes.object,
multiple: React.PropTypes.bool,
onOpen: React.PropTypes.func,
onClose: React.PropTypes.func,
onSelect: React.PropTypes.func,
onChange: React.PropTypes.func,
onUnselect: React.PropTypes.func,
data: PropTypes.array,
events: PropTypes.array,
options: PropTypes.object,
multiple: PropTypes.bool,
onOpen: PropTypes.func,
onClose: PropTypes.func,
onSelect: PropTypes.func,
onChange: PropTypes.func,
onUnselect: PropTypes.func,
}

static defaultProps = {
Expand All @@ -33,7 +34,7 @@ export default class Select2 extends React.Component {
}

componentDidMount() {
this.el = $(React.findDOMNode(this));
this.el = $(ReactDOM.findDOMNode(this));
this.el.select2(this.props.options);

this.props.events.forEach(event => {
Expand Down

0 comments on commit 0b30d63

Please sign in to comment.