ES6(traceur) + Webpack + React

By : dakt
Source: Stackoverflow.com
Question!

Is it possible to develop React component in ES6?

For example:

import MyWdiget from './MyWidget';

React.render(<MyWidget />, mountNode);

also be able to use ES6 to define component:

class MyWidget extends ReactComponent {

    render() {
        <h3>Hello from Widget</h3>
    }
}

And somehow build all that using webpack? How would webpack config file look like?

I managed to compile ES6 code using traceur and webpack, but cannot transform JSX to javascript and also extend class using ES6.

Thx

By : dakt


Answers

You most definitely can use ES6 to build React Components.

import React from 'react';

class Hello extends React.Component {
  render() : {
    return 


This video can help you solving your question :)
By: admin