JedWatson / JedWatson/react-select

RollUp JS: TypeError: Cannot read property 'inputValue' of undefined

Open
#3,452 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

awaiting-author-response
Dominant language
TypeScript
Stars
28k
Forks
4.1k
PR merge metrics
No merged PRs in 30d

Description

package.json

  "react-select": "^2.4.1",

File CountryPicker.js:

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

const options: Object = [
   {value: 'chocolate', label: 'Chocolate'},
   {value: 'strawberry', label: 'Strawberry'},
   {value: 'vanilla', label: 'Vanilla'}
];

class CountryPicker extends Component {
   render () {
     return (
       <Select options={options} inputValue={'strawberry'}/>
     );
   }
}

Usage:

class App extends React.Component {
   render () {
       return <CountryPicker/>;
   }
}

// Always starts once doom
document.addEventListener('DOMContentLoaded', () => {
   /** @type {HTMLDivElement} */
   let elm = document.querySelector('div#root');

   // noinspection ES6ModulesDependencies
   ReactDOM.render(<App />, elm);
});

And the rest:

TypeError: Cannot read property 'inputValue' of undefined
    at new StateManager (react-select.esm.js:4559)
    at Yf (react-dom.production.min.js:67)
    at qg (react-dom.production.min.js:92)
    at hi (react-dom.production.min.js:104)
    at Qg (react-dom.production.min.js:144)
    at Rg (react-dom.production.min.js:145)
    at Sc (react-dom.production.min.js:158)
    at Z (react-dom.production.min.js:156)
    at Kc (react-dom.production.min.js:155)
    at ya (react-dom.production.min.js:153)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with package.json and the CountryPicker.js reproduction using react-select 2.4.1, then trace the StateManager constructor shown in the stack trace. Confirm the error with the provided App example and identify the change needed so rendering no longer throws the inputValue TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.