Skip to content

TypeError: __webpack_require__.i(…) is not a function in React-Select #3653

@shashankshahplutus

Description

@shashankshahplutus

I am using react-select plugin for multiple selection from dropdown.

For installation i have done

npm install react-select --save

which installed latest version 3.0.4 of react-select plugin

My code is


import React, { Component } from 'react';
import Select from 'react-select';

import urls from '../../../urls.json';

const options = [
  { value: 'chocolate', label: 'Chocolate' },
  { value: 'strawberry', label: 'Strawberry' },
  { value: 'vanilla', label: 'Vanilla' },
];
class Reports extends Component {

  constructor(props) {
    super(props);

    this.state = {
      selectedOption: null,
    };

  }
  handleChange = selectedOption => {
    this.setState({ selectedOption });
    console.log(`Option selected:`, selectedOption);
  };
  componentDidMount() { }

  render() {

    return (
      <div>
        <div className="row">
          <div className="col-md-12">
            <h2>Reports</h2>
            <hr className="title-separator" />
            <Select
                value={this.state.selectedOption}
                onChange={this.handleChange}
                options={options}
            />
          </div>
        </div>
      </div >
    )
  }
}

export default Reports;

image
Please help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-author-responseIssues or PRs waiting for more information from the authorissue/bug-unconfirmedIssues that describe a bug that hasn't been confirmed by a maintainer yetissue/reviewedIssue has recently been reviewed (mid-2020)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions