Does it matter if I import React or not? #14896
Answered
by
Timer
lloydjatkinson
asked this question in
Help
-
I use ESLint and the default index.js file is causing a warning around JSX and React - I can either |
Beta Was this translation helpful? Give feedback.
Answered by
Timer
Jul 6, 2020
Replies: 1 comment
-
Next.js automatically imports React for you in the most optimized way. You can safely turn off this lint rule. If you're going to import yourself, you should use the following for the most optimized bundle output: import * as React from 'react'; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Timer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Next.js automatically imports React for you in the most optimized way. You can safely turn off this lint rule.
If you're going to import yourself, you should use the following for the most optimized bundle output: