react-input-autosize "window" reference breaks test environment
See original GitHub issueAre you reporting a bug or runtime error?
Yes.
Version
Any version of react-select
that pulls in react-input-autosize
at 2.2.0
.
Summary
Our test suite will no longer run (in a headless environment) due to this error:
/node_modules/react-input-autosize/lib/AutosizeInput.js:57
var isIE = typeof window === 'undefined' && window.document ? false : /MSIE |Trident\/|Edge\//.test(window.navigator.userAgent);
^
ReferenceError: window is not defined
at Object.<anonymous> (/Users/emily/webapp/node_modules/react-input-autosize/lib/AutosizeInput.js:57:45)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Re-render a React Component on Window Resize | Pluralsight
This will create n new event bindings of handleResize to the resize event. If this component is re-rendered often, this could create a...
Read more >Test Utilities - React
ReactTestUtils makes it easy to test React components in the testing framework of your choice. At Facebook we use Jest for painless JavaScript...
Read more >JedWatson/react-input-autosize - GitHub
React -Input-Autosize generates an input field, wrapped in a <div> tag so it can detect the size of its value. Otherwise it behaves...
Read more >Rerender view on browser resize with React - Stack Overflow
Using React Hooks: You can define a custom Hook that listens to the window resize event, something like this: import React, { useLayoutEffect,...
Read more >How To Test a React App with Jest and React Testing Library
js suffix in __tests__ folders. When you make changes to the relevant test files, they will be detected automatically. As test cases are ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fixed in react-input-autosize@2.2.1
This is the issue.