Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReferenceError react is not defined ? #23

Closed
PokerJava opened this issue Jan 27, 2022 · 4 comments · May be fixed by #32
Closed

ReferenceError react is not defined ? #23

PokerJava opened this issue Jan 27, 2022 · 4 comments · May be fixed by #32

Comments

@PokerJava
Copy link

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

@RobPethick
Copy link
Owner

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

@TeckTn
Copy link

TeckTn commented Feb 25, 2022

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.

@julianlionti
Copy link

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

@danieljaguiar
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants