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

With React 17, i get error, React is not defined. #12

Closed
spyridonas opened this issue Feb 6, 2021 · 1 comment
Closed

With React 17, i get error, React is not defined. #12

spyridonas opened this issue Feb 6, 2021 · 1 comment

Comments

@spyridonas
Copy link

With React 17 i get error, React is not defined.
My craco.config.js is the minimal as suggested by the guide.

const CracoEsbuildPlugin = require('craco-esbuild');

module.exports = {
  plugins: [{ plugin: CracoEsbuildPlugin }],
};

Please note that i don't have

import React from "react";

Because it's not needed in react 17+

@spyridonas spyridonas changed the title With React 17 i get error, React is not defined. With React 17, i get error, React is not defined. Feb 6, 2021
@pradel
Copy link
Owner

pradel commented Feb 6, 2021

Closing in favor of #7, but basically, esbuild does not support this yet. If you want to use this plugin you have to import React in all your files.

@pradel pradel closed this as completed Feb 6, 2021
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

No branches or pull requests

2 participants