Socket
Socket
Sign inDemoInstall

gatsby-plugin-provide-react

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gatsby-plugin-provide-react

Provides to all of your component React instances, you don't need to import React anymore.


Version published
Weekly downloads
4.6K
increased by11.98%
Maintainers
1
Install size
14.4 kB
Created
Weekly downloads
 

Readme

Source

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"
  }
}

Keywords

FAQs

Last updated on 01 Apr 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc