Skip to content

Mixing ES5 & 6 #19

@stiofand

Description

@stiofand

There seems to be a bit of a mix between ES6 and ES5, perhaps keeping it consistent is better practice (I suggest ES6 since you have chosen to use babel loaders and compiler).

For example, Initially main could just be written as:

import React from 'react';
import { Link } from 'react-router-dom'; // notice the latest react router(v4+)

const Main = props =>(
    <div>
        <h1>
            <Link to="/" >Reduxstagram</Link>
        </h1>
        {props.children} // no 'this' here, since arrow functions do not carry the this context
    </div>);

export default Main;   

Stick to const and let, at the very least.

React.createClass is also dissuaded in favour of the static function (as shown above)or ES6 React class, again this is possible as you have set up the babel process. (with the react-loader).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions