hzdg / react-google-analytics

Google analytics component
Other
111 stars 9 forks source link

React.createClass deprecation warning on React version 15.5.4 - will be removed in React 16 #8

Open jayiconcmo opened 7 years ago

jayiconcmo commented 7 years ago

Warning: GAInitializer: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.

in index.js 39

Thank you

MoOx commented 6 years ago

React.DOM.script is breaking with react 16 atm. This module is unusable with react 16.

HeyParkerJ commented 6 years ago

If you need a quick fix for React 16, it's an easy change - just pull this script into a local util, npm install react-dom-factories (then add the import to the top of the util), change line 6 from script = React.DOM.script; to script = myReactGoogleAnalyticsReplacementUtil.script;, and then import it in place of this module where needed.

MoOx commented 6 years ago

Or use react-ga ;)