package gwt.react.todo_mvc.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dom.client.Document;
import gwt.interop.utils.client.collections.JsArray;
import gwt.interop.utils.shared.collections.Array;
import gwt.react.client.api.React;
import gwt.react.client.api.ReactDOM;
import gwt.react.client.elements.ReactElement;
import gwt.react_router.client.ReactRouter;
import gwt.react_router.client.RouteProps;
import gwt.react_router.client.RouterProps;

import static gwt.react.client.api.GwtReact.castAsReactElement;
import static gwt.react_router.client.ReactRouter.Route;
import static gwt.react_router.client.ReactRouter.Router;

public class App implements EntryPoint {

    static final int ESCAPE_KEY = 27;
    static final int ENTER_KEY = 13;

    static TodoModel model = new TodoModel();
    static Array<ReactElement> routes = JsArray.create();

    private void render() {
        ReactDOM.render(
            React.createElement(Router, new RouterProps().History(ReactRouter.hashHistory),
                    castAsReactElement(routes)

            ),
            Document.get().getElementById("todoapp"));
    }

    @Override
    public void onModuleLoad() {

        //React Router now requires that you only create the Routes once so define them statically
        routes.push(React.createElement(Route, new RouteProps().path("/").component(TodoList.component)));
        routes.push(React.createElement(Route, new RouteProps().path("/:nowShowing").component(TodoList.component)));

        model.subscribe(this::render);
        render();
    }
}
@@ -818,24 +818,32 @@
 odel();%0A    
+private 
 static Array
@@ -884,16 +884,16 @@
 eate();%0A
-
 %0A    pri
@@ -1080,22 +1080,8 @@
 tes)
-%0A%0A            
 ),%0A 
@@ -1326,32 +1326,48 @@
 teElement(Route,
+%0A               
  new RouteProps(
@@ -1371,52 +1371,125 @@
 ps()
-.path(%22/%22).component(TodoList.component
+%0A                    .path(%22/%22)%0A                    .component(TodoList.component)%0A                    .key(%221%22
 )));%0A
+%0A
     
@@ -1530,16 +1530,32 @@
 t(Route,
+%0A               
  new Rou
@@ -1567,58 +1567,130 @@
 ps()
-.path(%22/:nowShowing%22).component(TodoList.component
+%0A                    .path(%22/:nowShowing%22)%0A                    .component(TodoList.component)%0A                    .key(%222%22
 )));

Support React 15.3.2 and GWT 2.8 final release