Techbot
Techbot

Reputation: 1

Using import with reactjs

Hi I'm following a few different reactjs tutorials.

eg http://tomchentw.github.io/react-google-maps/

so how does one avoid

SyntaxError: modules are not implemented yet    

import React from "react/addons";

I assume I need to preload a shim or something (compile from es6 to legacy js?). Or is there another method for using import (outside of es6)?

Upvotes: 0

Views: 648

Answers (1)

JMM
JMM

Reputation: 26797

Try using Babel in some fashion to transpile or process your source. It looks like the project you referenced is using babel-loader via webpack.

Upvotes: 4

Related Questions