gatsby-plugin-provide-react

1.0.2 • Public • Published

Version Downloads Total

gatsby-plugin-provide-react

You don't need to import React anymore. Say good bye to:

import React from "react"

Provides to all of your components React instances.

Install

$ npm i gatsby-plugin-provide-react

or

$ yarn add gatsby-plugin-provide-react

How to use

Add the plugin to your gatsby-config.js.

module.exports = {
  plugins: [
    `gatsby-plugin-provide-react`
  ]
}

Common error

If you are getting:

error  'React' must be in scope when using JSX

You need to create an empty .eslintrc in root of your folder. This error occurs from eslint.

If you are using eslint in your project, just update this key to your config:

{
  "rules": {
    "no-undef": "off"
  }
}

/gatsby-plugin-provide-react/

    Package Sidebar

    Install

    npm i gatsby-plugin-provide-react

    Weekly Downloads

    2,916

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    13.5 kB

    Total Files

    12

    Last publish

    Collaborators

    • victorfellype
    • luanbitar