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
Source: stackoverflow.com
Related Query
- ReactJS/ES6: Equivalence between two blocks of code
- How to add a <br> tag in reactjs between two strings?
- What's difference between two ways of defining method on React Class in ES6
- Difference between two type of assignments in reactjs
- reactJs : Communication between two different components
- Communicate between two components reactjs
- ReactJS tutorial code ported ES6 Code not working
- How to svg morph in ReactJs between two elements
- How to pass an element between two components in reactJS
- Add delay between two functions in reactjs
- How can I set a logical operator between two spread operators in ES6
- move between two div with tow button using reactjs
- Code sharing between React ES6 Classes
- Distributing ReactJS components written in ES6 and usnig them inside ES5 source code
- reactjs - communication between two components
- Why aren't the two code blocks equivalent?
- How to correctly route between two similar pathnames in reactjs router
- reactjs - moving list items back and forth between two components
- How to center this div between two div colums in reactjs using only css
- Difference between this two reactjs setState behavior
- the difference between those two className in reactjs
- Unable to draw the default line between two location in OpenLayers with ReactJS
- How to communicate between two components in Reactjs
- reactjs transferring the data between two components
- What is the difference between these two usages of functional component in ReactJs
- Communication between two components using ReactJS
- What's the difference between "super()" and "super(props)" in React when using es6 classes?
- How to make a shared state between two react components?
- What is the difference between Reactjs and Rxjs?
- Difference between production and development build in ReactJS
More Query from same tag
- Storybook w/ react-router - You should not use <Link> outside <Router>
- How to toggle two different buttons (function/text) based on external condition (e.g. num of items purchase)
- How to use nested loop in react
- React Router causing AJAX call in Reflux store to fail
- "Parsing error: invalid character" when bundling images with Webpack's loaders
- React Ant Design type input value not clear
- Refer to another webpage when pressing the button
- How can I use <script> tags inside a JSX file?
- Using toJSON or not with Snapshot testing with Jest
- Formatting React Semantic UI List 'Field Name' and 'Value'
- Webpack and programmatically injected content scripts
- REACTJS - How to have "Good Design" - avoid try to run a child method from parent
- state in mapStateToProps is JSX! React / Redux
- Add a disabled field to a checkbox if a user has checked a certain amount
- Handle response - SyntaxError: Unexpected end of input when using mode: 'no-cors'
- How to pass information from a form into a function in react
- How can I remove duplicate values ​from my json in React
- Exposing React Components using Webpack
- How to handle Meteor Data that requires state from child component?
- Weird value bug onChange in React JS
- React.js Log out did not turn into log in after I log out in nav bar
- What is the React way of doing Angular's orderBy
- Failed to load resources error 404 while deploying create-react-app
- How to validate Forms Controls to use only numeric values with react-bootstrap
- how to keep session enabled in firebase/auth js?
- I have to click on my link twice before state is update and styling is changed
- npm peerDependency - can't install package
- Active class for button groups in ReactJs
- React JS - hide a text of the parent component by clicking on the NavLink
- Not render when Apollo query is 'loading' - React