0

I have installed version 15.2.1 of react, react-addons-shallow-compare, and react-dom. When I try to use react-virtualized, I get an error on the Chrome console saying

external "React.addons.shallowCompare":1Uncaught ReferenceError: React is not defined

Without using react-virtualized, React is working fine. Not sure why I am getting this error.

Monty
  • 361
  • 1
  • 3
  • 8
  • Any chance you can point at a reproduction? I'm not able to reproduce the behavior you describe. – bvaughn Jul 21 '16 at 23:56

1 Answers1

0

Never mind. Figured it out. I was using the UMD build of react-virtualized but with a non-UMD build of React and React.addons.shallowCompare. If you're using a bundler like Webpack, there likely isn't a global React variable.

In this case, you should use the CommonJS or ES6 builds of react-virtualized.

Monty
  • 361
  • 1
  • 3
  • 8