Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Router Basics Getting Started with React Router Installing React Router and Declaring a Route

Sergio Lopez
Sergio Lopez
2,892 Points

Does this app work without using ES2015? Like regular component import?

I wonder if is needed to use the ES2015 syntax since all react router examples and tutorial works with this syntax

1 Answer

Hey Sergio,

You could absolutely use the older JavaScript syntax. Both of these two lines will serve the same function in a React application, for example:

var React = require('react'); //ES5
import React from 'react'; //ES6

The React development philosophy seems to be to try to keep things as up-to-date as possible with the newest changes to ECMAScript, so it's good to know and understand ES6 well if you are working with React applications.

Leslie