score:2

Accepted answer

as per documentation for components "stateless functions":

you may also define your react classes as a plain javascript function. for example using the stateless function syntax ...

so in your case it works because you are using just a plain function instead of class. es2015 syntax here is basically translates to:

export default function(task) {
    return <div>{task}</div>;
};

score:1

you can use the below mentioned link of babel in that mentioned the all different between in es5 and es6

babel


Related Query

More Query from same tag