react-select-plus icon indicating copy to clipboard operation
react-select-plus copied to clipboard

TypeError: Cannot read property 'string' of undefined

Open techuila opened this issue 6 years ago • 3 comments

TypeError: Cannot read property 'string' of undefined ./node_modules/react-input-autosize/lib/AutosizeInput.js node_modules/react-input-autosize/lib/AutosizeInput.js:31 28 | var AutosizeInput = React.createClass({ 29 | displayName: 'AutosizeInput', 30 | propTypes: {

31 | className: React.PropTypes.string, 32 | // className for the outer element 33 | defaultValue: React.PropTypes.any, 34 | // default field value

techuila avatar Nov 05 '19 03:11 techuila

Same for me when using import { AsyncCreatable } from "react-select-plus";

evaluate
https://fqqlk.csb.app/node_modules/react-input-autosize/1.1.0/lib/AutosizeInput.js:13:30
z
https://codesandbox.io/static/js/sandbox.5a7ff733c.js:1:98419
X.evaluate
https://codesandbox.io/static/js/sandbox.5a7ff733c.js:1:110543
ye.evaluateTranspiledModule
https://codesandbox.io/static/js/sandbox.5a7ff733c.js:1:120123
c
https://codesandbox.io/static/js/sandbox.5a7ff733c.js:1:110289
evaluate
https://fqqlk.csb.app/node_modules/react-select-plus/lib/Select.js:29:27
z
https://codesandbox.io/static/js/sandbox.5a7ff733c.js:1:98419
X.evaluate
https://codesandbox.io/static/js/sandbox.5a7ff733c.js:1:110543
ye.evaluateTranspiledModule
https://codesandbox.io/static/js/sandbox.5a7ff733c.js:1:120123
c
https://codesandbox.io/static/js/sandbox.5a7ff733c.js:1:110289
evaluate
/CompaniesSelectField.js:2
  1 | import React, { useState } from "react";
> 2 | import { AsyncCreatable } from "react-select-plus";
  3 | // import AsyncCreatable from "react-select/async-creatable";
  4 | 
  5 | export function CompaniesSelectField(props) {
View compiled

flora8984461 avatar Jan 04 '21 18:01 flora8984461

Same issue when importing "Select" or "Creatable"

MicahBly avatar Apr 24 '21 06:04 MicahBly

This happens because react-select-plus uses an old build of react-input-autosize.

Both builds depends on React.PropTypes which is deprecated as of React v15.5.

Please update react-select-plus to use the prop-types library instead, and update the react-input-autosize dependency to a more resent build (that has already been updated to use prop-types library).

UPDATE

I just realized this only happens if you use the npm package, because it's not updated with the current github version (so the real request here would be to update the npm package :)

urlund avatar May 26 '21 08:05 urlund