Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
Import ReactSelect as component to allow dynamic use in Registry (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
starsinmypockets authored and topicus committed Jul 6, 2016
1 parent 7a44021 commit 9c446af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/ReactDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export {default as Metric } from './components/Metric';
export {default as Multi} from './components/Multi';
export {default as Table } from './components/Table';
export {default as Text } from './components/Text';
export {default as ReactSelect} from './components/ReactSelect';

// UTILS
export {default as Registry } from './utils/Registry';
Expand Down
5 changes: 2 additions & 3 deletions src/components/Autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
*/

import React, { Component } from 'react';
import Select from 'react-select';
import Registry from '../utils/Registry';
import {makeKey} from '../utils/utils';
import BaseComponent from './BaseComponent';
import DashboardConstants from '../constants/DashboardConstants';

import ReactSelect from './ReactSelect';

export default class Autocomplete extends BaseComponent {

Expand Down Expand Up @@ -62,7 +61,7 @@ export default class Autocomplete extends BaseComponent {

render(){
return (
<Select.Async value={this.state.value} loadOptions={this.loadOptions.bind(this)} {...this.props} onChange={this.onChange.bind(this)}/>
<ReactSelect.Async value={this.state.value} loadOptions={this.loadOptions.bind(this)} {...this.props} onChange={this.onChange.bind(this)}/>
);
}
}
Expand Down
7 changes: 7 additions & 0 deletions src/components/ReactSelect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Registry from '../utils/Registry';
import Select from 'react-select';

let ReactSelect = Select;
export default ReactSelect;

Registry.set('ReactSelect', Select);

0 comments on commit 9c446af

Please sign in to comment.