Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
addComponentAsRefTo Invariant Violation

You are probably here because you got the following error messages:

addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded.

This usually means one of two things:

  • You are trying to add a ref to an element that is being created outside of a component's render() function.
  • You have multiple (conflicting) copies of React loaded (eg. due to a miss-configured NPM dependency)

Invalid Refs

Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component's render method). Try rendering this component inside of a new top-level component which will hold the ref.

Multiple copies of React

Bower does a good job of deduplicating dependencies, but NPM does not. If you aren't doing anything (fancy) with refs, there is a good chance that the problem is not with your refs, but rather an issue with having multiple copies of React loaded into your project. Sometimes, when you pull in a third-party module via npm, you will get a duplicate copy of the dependency library, and this can create problems.

If you are using npm... npm ls or npm ls | grep react might help illuminate.

@hgezim

This comment has been minimized.

Copy link

hgezim commented Sep 18, 2015

Thank you so much! Here's insert something you love x 5 for you :)

@colllin

This comment has been minimized.

Copy link

colllin commented Oct 14, 2015

In case someone else gets here the same way I did -- I couldn't figure out how I could be getting multiple copies of React, and I wasn't using refs. The only way I could get rid of this error was to delete my local repository and re-clone it from github. Then it went away.

@jasongonzales23

This comment has been minimized.

Copy link

jasongonzales23 commented Oct 14, 2015

@colllin, just to add to your comment, I ran rm -rf node_modules ran npm install and the error went away.

@thedumbtechguy

This comment has been minimized.

Copy link

thedumbtechguy commented Oct 14, 2015

Mine was caused when I updated using npm update.

Somehow, react-dom was included and it had react as a dep. Seems it was installed before my old react version was updated.

Removing react and react-dom from the node_modules dir and reinstalling fixed my problem.

@GimYoungPhil

This comment has been minimized.

Copy link

GimYoungPhil commented Oct 15, 2015

Thanks frostymarvelous :)

npm uninstall react react-dom
npm install react react-dom --save

@ericlathrop

This comment has been minimized.

Copy link

ericlathrop commented Oct 19, 2015

Thanks @colllin, that was my issue. I was going crazy trying to figure out what was wrong with my refs!

@JedWatson

This comment has been minimized.

Copy link

JedWatson commented Oct 27, 2015

You can also end up with multiple copies of react@0.14 when you're using Browserify, even when you don't have duplicate dependencies as described above.

If you build react into a common bundle, and then exclude it from your app bundle using the external option, and use react-dom in your app, you must also build react-dom into your common bundle and exclude it from your app bundle as well.

The entry point for react-dom is

module.exports = require('react/lib/ReactDOM');

... which Browserify will misunderstand, and you'll end up with multiple copies of React on your page.


Note that you can fall for this trap even when you're not using react-dom directly; if any of the dependencies in your app bundle have require('react-dom') in them, the trap will be sprung!

@frantic1048

This comment has been minimized.

Copy link

frantic1048 commented Oct 28, 2015

Thanks @GimYoungPhil !
works great πŸ‘

@titanve

This comment has been minimized.

Copy link

titanve commented Oct 29, 2015

@JedWatson hello, I did: browserify --external react --external react-dom -t babelify main.js -o bundle.js and it says that it cant find module 'react'
What can I do?

@martingg88

This comment has been minimized.

Copy link

martingg88 commented Oct 30, 2015

@titanve you manage to the solve issue?

@tjconcept

This comment has been minimized.

Copy link

tjconcept commented Oct 30, 2015

I had to update npm (2.14.7 - comes with Node.js 4) to version 3. The problem was obvious:

Before

# npm ls | grep react
β”œβ”€β”¬ react@0.14.1
β”œβ”€β”€ react-addons-pure-render-mixin@0.14.1
β”œβ”€β”¬ react-dom@0.14.1
β”‚ └─┬ react@0.14.1

After

# npm ls | grep react
β”œβ”€β”¬ react@0.14.1
β”œβ”€β”€ react-addons-pure-render-mixin@0.14.1
β”œβ”€β”€ react-dom@0.14.1
@freewayz

This comment has been minimized.

Copy link

freewayz commented Nov 1, 2015

Awesomw work @GimYoungPhil !
It solves the issue

@esthercodes

This comment has been minimized.

Copy link

esthercodes commented Nov 3, 2015

@tjconcept thanks! I didn't even have to reinstall anything with npm version 3.x

@jdpagley

This comment has been minimized.

Copy link

jdpagley commented Nov 3, 2015

@collin that was my issue as well! Removing all node modules and doing a fresh npm install worked like a charm.

@mfunkie

This comment has been minimized.

Copy link

mfunkie commented Nov 6, 2015

As long as the function is occurring during the render function, we should be fine, correct?

I have a list of dropdown items that are created in another function via a mapping function and they each have a ref, but am getting the error as soon as I open the dropdown (which triggers rendering these items)

@keithamus

This comment has been minimized.

Copy link

keithamus commented Nov 12, 2015

@jimfb FYI npm ls react is a better alternative to npm ls | grep react.

@kiki-le-singe

This comment has been minimized.

Copy link

kiki-le-singe commented Nov 21, 2015

Thanks you saved me :D

@elijahe

This comment has been minimized.

Copy link

elijahe commented Nov 24, 2015

@JedWatson Thanks! That was exactly the issue I ran into. You saved me a lot of time.

@odewahn

This comment has been minimized.

Copy link

odewahn commented Nov 25, 2015

Thanks so much for posting this!

@jpsierens

This comment has been minimized.

Copy link

jpsierens commented Nov 26, 2015

As @JedWatson said, I am also using browserify and use the .external function for dependencies. When I switched to react 0.14 this error started happening. After hours of looking I found out that I had to add 'react-dom' as well to the dependencies, now it works fine.

@michaelatmender

This comment has been minimized.

Copy link

michaelatmender commented Dec 2, 2015

This helped me a lot, thank you!

@Dombo

This comment has been minimized.

Copy link

Dombo commented Dec 2, 2015

@JedWatson big thank you!

@Markues

This comment has been minimized.

Copy link

Markues commented Dec 3, 2015

@JedWatson @jpsierens Big thanks - I had the same issue. For anyone who is using Browserify/Gulp I had to update my gulpfile and add all my react-centric modules to my list of dependencies:

var dependencies = [
'alt',
'react',
'react-dom',
'react-router',
'react-selectize',
'underscore'
];

return browserify()
.require(dependencies)
.bundle()

@cht8687

This comment has been minimized.

Copy link

cht8687 commented Dec 9, 2015

Deleted node_module folder and npm install again, problem gone.

@wle8300

This comment has been minimized.

Copy link

wle8300 commented Dec 10, 2015

@JedWatson @jpsierens @Markues Thanks guys! This helped solve the problem.

@justgook

This comment has been minimized.

Copy link

justgook commented Dec 14, 2015

Maybe it will solve some problems for others too: i have 2 bundles build by browserify (vendor and index), of course React goes to vendor bundle - so if u will try require some Addon (for it was react-addons-css-transition-group) in index (do not build it to the vendor bundle) then u will got 2 React instances.. - all addons must go to same bundle as react!

@michaeljones

This comment has been minimized.

Copy link

michaeljones commented Dec 15, 2015

I had trouble as I was using the externals setting in Webpack to stop react and react-dom from being included in the bundle. Unfortunately react-addons-css-transition-group doesn't require react as exactly that string and so the externals mechanism was failing. Switching to the Webpack vendor bundle approach works.

@SylarRuby

This comment has been minimized.

Copy link

SylarRuby commented Dec 15, 2015

Is this compatible with react-rails? Tried almost everything but same error warning message.

@mrcrlee

This comment has been minimized.

Copy link

mrcrlee commented Dec 28, 2015

I also had trouble with externals in a Sails app using grunt and the browserify plugin. I was able to track down that I needed to add react-dom to the list of externals to avoid the error.

@debradley

This comment has been minimized.

Copy link

debradley commented Dec 31, 2015

The issue with Browserify applies to webpack as well - react-dom needs to be made external:

  externals: {
    'react': 'React',
    'react-dom': 'ReactDOM'
  }
@wmyers

This comment has been minimized.

Copy link

wmyers commented Jan 4, 2016

@JedWatson thanks a lot

@greygatch

This comment has been minimized.

Copy link

greygatch commented Jan 8, 2016

@tjconcept 's solution fixed my bug. Simply updating NPM was the key.

@throoze

This comment has been minimized.

Copy link

throoze commented Jan 15, 2016

@mfunkie did you solve the issue? i think i might be in the same situation that you were. Did you figure something out?

@rhys-vdw

This comment has been minimized.

Copy link

rhys-vdw commented Jan 19, 2016

@JedWatson I'm hitting this problem just npm linking a project to a local fork of your react-select. Have you had this problem?

@Zacqary

This comment has been minimized.

Copy link

Zacqary commented Jan 20, 2016

Expanding on the tip from @justgook: we ran into a Multiple Copies of React issue when using multiple Webpack bundles. Similar situation: a plugins and react bundle.

In plugins, we had this:

import React from "react";
window.React = React;

in order to expose React as a global to legacy code that we hadn't Webpackified yet. But other code inside the react bundle was also declaring

import React from "react";`

and importing third-party React modules. That was causing problems.

The issue was fixed by moving the window.React = React declaration into the same react bundle with everything else that calls import React.

TL;DR: only import/require React or modules that depend on React in one Webpack/Browserify/JSPM/whatever bundle. If you don't do that, you're going to run into invariant violations.

@patrickheeney

This comment has been minimized.

Copy link

patrickheeney commented Jan 21, 2016

Has anyone solved this?

@Zacqary Doesn't this eliminate bundling since any components require React to be imported which is typically in a separate bundle then other vendor modules that may also import React?

@vyorkin

This comment has been minimized.

Copy link

vyorkin commented Feb 1, 2016

@DClark5218

This comment has been minimized.

Copy link

DClark5218 commented Feb 1, 2016

Thanks @JedWatson! Worked for me using external.

@makenosound

This comment has been minimized.

Copy link

makenosound commented Feb 1, 2016

I ran into this problem using npm link for a local dependency while in development and, after bashing my head against this for the better part of a day, I managed to get it working again. The steps were:

  1. Move react (and anything that requires react as an explicit dependency) to peerDependencies in my local component. Then you can require react as a dependency in the consuming app.

  2. Run npm link ~/path-to-my/local-component as usual in the consuming app.

  3. This caused a problem for me with my webpack build: the linked component would no longer resolve any dependencies from within the consuming app. I had to explicitly tell webpack where to resolve node_modules:

    // webpack.config.js
    module.exports = {
      ...
      // Set the resolve paths to _our_ node_modules
      // For modules
      resolve: {
        fallback: [path.join(__dirname, 'node_modules')]
      },
      // Same issue, for loaders like babel
      resolveLoader: {
        fallback: [path.join(__dirname, 'node_modules')]
      },
      ...
    }

    ... and now everything resolves correctly and continues to build with a local dependency.

@ruchikagamage

This comment has been minimized.

Copy link

ruchikagamage commented Feb 2, 2016

i got this error
it's going to kill me

main.js:18467 Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's render method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
//##################################################################
$ npm version
{ react_cycle: '1.0.0',
npm: '2.5.1',
http_parser: '2.3',
modules: '14',
node: '0.12.0',
openssl: '1.0.1l',
uv: '1.0.2',
v8: '3.28.73',
zlib: '1.2.8' }

this is my node_module

β”œβ”€β”€ babel-preset-react
β”œβ”€β”€ babelify
β”œβ”€β”€ email-validator
β”œβ”€β”€ babelify
β”œβ”€β”€ form-validate
β”œβ”€β”€ babelify
β”œβ”€β”€ react
β”œβ”€β”€ react-dom
β”œβ”€β”€ watchify

please anyone can help me
thank you

@adieuadieu

This comment has been minimized.

Copy link

adieuadieu commented Feb 28, 2016

Thanks @makenosound! Because I discovered your comment I spent only half my day bashing my head against this issue.

@HolaMan

This comment has been minimized.

Copy link

HolaMan commented Feb 29, 2016

I have the same issue and don't have duplicate react !!!!

return <div style={{width: '100%'}}>Hello React Cropper
            <World />
            <World />
            <World />
            <Cropper
                style={{height: 400, width: '100%'}}
                aspectRatio={16 / 9}
                preview='.img-preview'
                guides={false}
                src={this.state.src}
                ref='cropper'
                crop={this._crop} />

        </div>

Cropper just keep throw this error !!
I already rm all npm modules and re-install npm install
but it seems not duplicate react problem

@cacaocake

This comment has been minimized.

Copy link

cacaocake commented Mar 7, 2016

@debradley thank you!

@costea93

This comment has been minimized.

Copy link

costea93 commented Mar 9, 2016

@debradley a lot of thanks )

@nigelmcnie

This comment has been minimized.

Copy link

nigelmcnie commented Mar 17, 2016

You will also get this error if you name one of your props 'ref' - at least in older versions of react. This github issue talks about issuing a nicer warning to help with this, but on react 0.14.7 at least, the fix isn't present.

@manubamba

This comment has been minimized.

Copy link

manubamba commented Mar 22, 2016

This worked for me and I could avoid the long rm -rf and nmp i process all over again.

  1. Find and delete all folders by the exact name react in your node_modules directory.
  2. Install react again: npm i react -S
  3. Run npm rebuild in the root of your project.
@machnicki

This comment has been minimized.

Copy link

machnicki commented Apr 8, 2016

I have had similar error because i use react component in main project and other component in child project (git submodules). I have resolved problem by adding alias in webpack config: 'react' : path.resolve(__dirname, 'node_modules/react'),

@Xantier

This comment has been minimized.

Copy link

Xantier commented Apr 12, 2016

FYI: This will also happen if using Proxyquire to mock a dependency and using the @global:true flag.

@ctrlplusb

This comment has been minimized.

Copy link

ctrlplusb commented Apr 14, 2016

Another gotcha for loading a different version of React without your knowledge...

I am a library author, and generally I create a subfolder (i.e. examples) with which to show off different implementations of my library. The examples generally have their own package.json etc, giving me a structure like so:

mylib
  | -> examples
  |     |-> node_modules
  |     |-> src
  |           |-> demo.js 
  |     |-> package.json
  | -> node_modules
  | -> src
  |     |-> MyLib.js
  | package.json

However, it's important to note that although my examples folder contains it own package.json etc I make a direct reference to my library source from within the examples folder.

Imagine demo.js from above had the following:

import MyLib from '../../src/MyLib.js';

// do stuff

This actually works, in principal, but it caused the very issue being discussed on this thread. Within MyLib I had a higher order component, which obv pulls in a React import, and the higher order component had a requirement on the use of refs.

It took me ages to figure this out but it appears that because I am pulling the MyLib.js reference one folder up from my examples folder the React reference for MyLib.js was resolving to the node_modules folder closest to it. So now I had two React instances running in my code.

I had no idea this could happen, and perhaps it's a result of my specific tooling configuration (Babel 6 and Webpack), but I spent the last day debugging this and read this thread many times over. Perhaps this can save someone else's sanity one day.

@KidLinus

This comment has been minimized.

Copy link

KidLinus commented Apr 18, 2016

I had no multiple imports in npm but webpack packed react into the source twice due to me using the unspecific import path.

Then:
import ReactDOM from 'react-dom';
Now:
import ReactDOM from 'react/lib/ReactDOM';

@traviss0

This comment has been minimized.

Copy link

traviss0 commented Apr 21, 2016

As @Markues pointed out:

For anyone using ReactCSSTransitionGroup I had to add it to my external dependency array as well.

var dependencies = [
    'alt',
    'react',
    'react-dom',
    'react-router',
    'react/lib/ReactCSSTransitionGroup',
    'lodash'
];
@dionatanaraujo

This comment has been minimized.

Copy link

dionatanaraujo commented Apr 24, 2016

  • Invalid Refs:

I had same problem and solved:

Before
var React = require('React');

After
var React = require('react');

@OttlikG

This comment has been minimized.

Copy link

OttlikG commented Apr 25, 2016

I solved the refs probleme with this:
npm dedupe

@ms-qing

This comment has been minimized.

Copy link

ms-qing commented Apr 26, 2016

@HolaMan I have the same problem with your. Do you have any solutions?

@BobbyAdamson

This comment has been minimized.

Copy link

BobbyAdamson commented May 8, 2016

@dionatanaraujo Wow this was my problem as well hah! Thank you

@Vyprichenko

This comment has been minimized.

Copy link

Vyprichenko commented May 13, 2016

I've managed to solve this problem with solution, mentioned by @vyorkin.

To import React with addons I had a webpack config section like this:
resolve: { alias: { 'react$': 'react/dist/react-with-addons.js' } }
which caused the problem and was not optimal of course due to loading pre-compiled script from dist.
My first solution was to add an alias to 'react-dom$': 'react-dom/dist/react-dom.js'

My final config is:
resolve: { alias: { 'react$': 'react/lib/ReactWithAddons.js', 'react-dom$': 'react/lib/ReactDOM.js' } }

@kebot

This comment has been minimized.

Copy link

kebot commented May 20, 2016

I run into this problem when I start my webpack server in msys, but it works will after I switch to cmd. It works well in Mac and Linux. So I guess it's a problem with msys or webpack.

@gparajon

This comment has been minimized.

Copy link

gparajon commented May 20, 2016

Thanks @debradley!!! That did it for me :)

@incleaf

This comment has been minimized.

Copy link

incleaf commented May 26, 2016

rm -rf node_modules
npm install

Works for me. Thanks!

@Panczo

This comment has been minimized.

Copy link

Panczo commented May 26, 2016

I'm using browserify rails and react-rails gem. I had this issue when i wanted to add reactdatetimepicker to my app. Nothing from above helped me. My problem gone when i removed //= require react and put inside my components.js React = require('react'); ReactDOM = require('react-dom');

@makarov-roman

This comment has been minimized.

Copy link

makarov-roman commented May 27, 2016

For me only full reinstalling of node_modules did worked.

@oklas

This comment has been minimized.

Copy link

oklas commented May 30, 2016

There two more reasons to multiple (conflicting) copies of React loaded caught to me:

  1. loading with require togather with duplicate loading from cdn by script tag in html.
    (to fix remove one of that)
  2. loading with require in project and loading with require in dependent library.
    (to fix configure externals webpack section of dependent library, set react as external)
@brickfungus

This comment has been minimized.

Copy link

brickfungus commented Jun 1, 2016

@OttlikG the dedupe finally worked for me

@infacq

This comment has been minimized.

Copy link

infacq commented Jun 7, 2016

any idea if using meteor system how to run check number of react loaded?

@skflowne

This comment has been minimized.

Copy link

skflowne commented Jun 13, 2016

I finally have been able to solve this for myself. I'm using Rails and was using react-rails for React integration. I moved on to this gem : https://github.com/netguru/react_webpack_rails

I guess my problem was a bit specific though. My problem was to import 'react-color' components and I kept getting the invariant error. I knew there was an issue specific to 'react-color' because 'react-css' would have a dependency with another React version and then I would have 2 versions.

But even trying with older versions not depending on 'react-css', I kept having the error even though I checked there was only one React version in npm.

I noticed they fixed it recently by depending on mochas instead, so I changed my dependencies to include the github version "react-color": "git+https://github.com/casesandberg/react-color/"

And now it finally works ! Hope this helps, I think going to webpack helped since it still didn't work with the older version of 'react-color'

@daifee

This comment has been minimized.

Copy link

daifee commented Jun 27, 2016

@michaeljones i solved it by change the order of loading script

before

<script src="cnd/react.js"></script>
<script src="cnd/react-dom.js"></script>
<script src="cnd/react-with-addons.js"></script>

after (work):

<script src="cnd/react.js"></script>
<script src="cnd/react-with-addons.js"></script>
<script src="cnd/react-dom.js"></script>
@mruhlin

This comment has been minimized.

Copy link

mruhlin commented Jul 19, 2016

I'm having this problem with npm link specifically.

I am developing a library that has react as a devDependency and using that library in a parent project that also uses react.
The library uses webpack in its build process to spit out a single js file that treats react as an external dependency.

So, if I do

cd /parentProject
npm install /myLibrary

myLibrary is installed into /parentProject/node_modules/myLibrary without its dev dependencies. So when I build the main project, only one copy of react gets included.

If I do

cd /myLibrary
npm install
npm link

cd /parentProject
npm link myLibrary

that npm install also installs all the devDependencies (including react) into /myLibrary/node_modules
the second npm link turns /parentProject/node_modules/myLibrary into a symbolic link pointing to /myLibrary

So now when I build my parent project, I guess the parts of myLibrary that are pointing to react pull in the one from /parentProject/node_modules/myLibrary/node_modules/react whereas the parts of parent project that reference react are getting it from /parentProject/node_modules/react.

I'm still an npm newbie, so no doubt I've screwed something up, but my short term workaround is to just stop using npm link, shrug.

@djllhs

This comment has been minimized.

Copy link

djllhs commented Aug 4, 2016

@jasongonzales23 works great

@ZLester

This comment has been minimized.

Copy link

ZLester commented Nov 17, 2016

@titanve Did you ever find a fix for this?

@mdoelker

This comment has been minimized.

Copy link

mdoelker commented Dec 21, 2016

I also experienced this error when a string ref was used multiple times while mapping over an array.

@fsalinasmendoza

This comment has been minimized.

Copy link

fsalinasmendoza commented Feb 11, 2017

@JedWatson Thank you very much!

@SoxFace

This comment has been minimized.

Copy link

SoxFace commented Feb 13, 2017

Hi guys, thanks so much for this thread. I'm a little confused as yarn ls and npm ls are returning different lists. Can anyone shed some light as I'm getting the same refs error outlined above.

yarn ls | grep react
β”œβ”€ hoist-non-react-statics@1.2.0
β”‚  β”œβ”€ react-addons-create-fragment@^15.0.0
β”‚  β”œβ”€ react-addons-transition-group@^15.0.0
β”‚  β”œβ”€ react-event-listener@^0.4.0
β”œβ”€ react-addons-create-fragment@15.4.2
β”œβ”€ react-addons-shallow-compare@15.4.2
β”œβ”€ react-addons-transition-group@15.4.2
β”œβ”€ react-dom@15.4.2
β”œβ”€ react-event-listener@0.4.1
β”‚  β”œβ”€ react-addons-shallow-compare@^15.4.2
β”œβ”€ react-tap-event-plugin@2.0.1
β”œβ”€ react@15.4.2
β”‚  β”œβ”€ hoist-non-react-statics@^1.0.0

$ npm ls | grep react
react_rails_starter_app@0.1.0 /Users/131432/Projects/atomicjolt/social_widgets
β”‚ β”œβ”€β”€ react-addons-create-fragment@15.4.2
β”‚ β”œβ”€β”€ react-addons-transition-group@15.4.2
β”‚ β”œβ”€β”¬ react-event-listener@0.4.1
β”‚ β”‚ └── react-addons-shallow-compare@15.4.2
β”‚ β”‚ β”œβ”€β”€ hoist-non-react-statics@1.2.0
β”œβ”€β”¬ react@15.4.2
β”œβ”€β”€ react-dom@15.4.2
└── react-tap-event-plugin@2.0.1

Cheers

@JakeDluhy

This comment has been minimized.

Copy link

JakeDluhy commented Mar 31, 2017

I got the same problem as @Xantier with proxyquire. Any luck solving that?

@mpyw

This comment has been minimized.

Copy link

mpyw commented Apr 3, 2017

I got the same as @SoxFace ...

@GideonShils

This comment has been minimized.

Copy link

GideonShils commented Jul 6, 2017

@nigelmcnie The GitHub issue you linked saved me, thanks!

@alexeychikk

This comment has been minimized.

Copy link

alexeychikk commented Feb 23, 2018

I've fixed this by replacing string ref with function ref in one of my deeply nested components.
I had:
<div ref="holder">...</div>
And replaced with:
<div ref={ref => (this.holderNode = ref)}>...</div>

@oscar-gomez

This comment has been minimized.

Copy link

oscar-gomez commented Apr 14, 2018

I have duplicated react module, I updated npm and the issue was resolved, if you enter "npm ls react", you should have this structure.
| -- react@15.6.2 deduped -- react@15.6.2

"DEDUPED" is what causes the problem to be solved

Thanks!

@bacchir

This comment has been minimized.

Copy link

bacchir commented Nov 18, 2018

Thanks man! You saved me a lot of hours.

@amir3code

This comment has been minimized.

Copy link

amir3code commented Jul 13, 2019

Thanks Great!
Guys if you are having problem with GATSBY TYPESCRIPT TSX file giving you this error:
Just Do this:

yarn add react react-dom

Be sure to add react-dom I just forgot it and wasted so much time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.