react-custom-scrollbars-2 icon indicating copy to clipboard operation
react-custom-scrollbars-2 copied to clipboard

ReferenceError react is not defined ?

Open PokerJava opened this issue 3 years ago • 4 comments

use react-custom-scrollbars-2 ReferenceError react is not defined

PokerJava avatar Jan 27 '22 14:01 PokerJava

Assumedly you just need to add

import React from 'react'; to the top of your page.

Doesn't sound like an issue with this lib

RobPethick avatar Jan 27 '22 14:01 RobPethick

Hi, I had this issue too when I migrate my create-react-app to vite. I have this issue only in prod build. I think that the library should not rely on some "auto-import" stuff to build correctly. import React from 'react'; in this library makes sense for me.

TeckTn avatar Feb 25 '22 12:02 TeckTn

HI! I have the same problem, React 17, vite and in production mode it says React is not defined. I don't know how to solve it

julianlionti avatar Mar 19 '22 14:03 julianlionti

Same here... any news on how to solve this problem?

danieljaguiar avatar Apr 20 '22 22:04 danieljaguiar