Fix select widgets with object type options.

This commit is contained in:
Caleb 2017-12-12 13:37:42 -07:00 committed by Shawn Erquhart
parent ba9b787366
commit 43a6c6ff15

View File

@ -1,7 +1,7 @@
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import { isMap } from 'immutable'; import { Map } from 'immutable';
export default class SelectControl extends React.Component { export default class SelectControl extends React.Component {
static propTypes = { static propTypes = {
@ -40,7 +40,7 @@ export default class SelectControl extends React.Component {
if (typeof option === 'string') { if (typeof option === 'string') {
return { label: option, value: option }; return { label: option, value: option };
} }
return isMap(option) ? option.toJS() : option; return Map.isMap(option) ? option.toJS() : option;
}), }),
]; ];