ahstro / react-dropdown-multiselect

A dead simple dropdown multiselect component for React
MIT License
1 stars 1 forks source link

react-dropdown-multiselect@1.0.0 requires a peer of react-dom@^0.14.0 but none was installed. #1

Closed niranjanbprajapati closed 7 years ago

niranjanbprajapati commented 8 years ago

while installing the react-dropdown-multiselect i am getting following error in terminal:

├── UNMET PEER DEPENDENCY react-dom@^0.14.0 └─┬ react-dropdown-multiselect@1.0.0 └── classnames@2.2.5

npm WARN EPEERINVALID react-dropdown-multiselect@1.0.0 requires a peer of react-dom@^0.14.0 but none was installed.

Application is not running properly

on the app screen it gives following error:

Requiring unknown module "react-dom". If you are sure the module is there, try restarting the packager.

Following is my code:

TestUI.js

'use strict';
import React,{
    View,
    Text,
    Component,
    StyleSheet,
    Image,
    Dimensions,
    TouchableOpacity
} from 'react-native';
import Dropdown from 'react-dropdown-multiselect';

class TestUI extends React.Component
{
    constructor() {
        super();
        this.state = {
            selected: { value: 'two', label: 'Two'}
        }
    } 
    _onSelect(option) {
        console.log('You selected ', option.label);
        this.setState({selected: option});
    }
    render(){
        const options = [
            { value: 'one', label: 'One' },
            { value: 'two', label: 'Two' },
            {
                type: 'group', name: 'group1', items: [
                { value: 'three', label: 'Three' },
                { value: 'four', label: 'Four' }
                ]
            },
            {
                type: 'group', name: 'group2', items: [
                { value: 'five', label: 'Five' },
                { value: 'six', label: 'Six' }
                ]
            }
        ];

        let defaultOption = this.state.selected;

        return (
            <Dropdown options={options} onChange={this._onSelect.bind(this)} value={defaultOption} placeholder="Select an option" />
        )
    }
}

export default TestUI;
ahstro commented 8 years ago

Thank you! I "made" (see "forked") this module for another project, didn't realize anyone other than I was using it. I'll try to find some spare time to update everything, but if you want to hack it yourself and submit a PR, that's welcome too :smile:

fj1800 commented 7 years ago

+1

ahstro commented 7 years ago

Should now allow React 15 as well :)

fj1800 commented 7 years ago

😁👍🎉