package gwt.react.todo_mvc.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.dom.client.Document;
import gwt.react.client.api.React;
import gwt.react.client.api.ReactDOM;
import gwt.react_router.client.ReactRouter;
import gwt.react_router.client.RouteProps;
import gwt.react_router.client.RouterProps;

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();

    private void render() {
        ReactDOM.render(
            React.createElement(Router, new RouterProps().History(ReactRouter.hashHistory),
                    React.createElement(Route, new RouteProps().path("/").component(TodoList.component)),
                    React.createElement(Route, new RouteProps().path("/:nowShowing").component(TodoList.component))

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

    @Override
    public void onModuleLoad() {

        model.subscribe(this::render);
        render();
    }
}
@@ -191,16 +191,139 @@
 actDOM;%0A
+import gwt.react.client.elements.ReactElement;%0Aimport gwt.react.client.utils.JSArray;%0Aimport gwt.react.shared.utils.Array;%0A
 import g
@@ -446,16 +446,80 @@
 Props;%0A%0A
+import static gwt.react.client.api.GwtReact.castAsReactElement;%0A
 import s
@@ -789,16 +789,74 @@
 Model();
+%0A    static Array%3CReactElement%3E routes = JSArray.create();
 %0A%0A    pr
@@ -1014,36 +1014,35 @@
         
-React.create
+castAsReact
 Element(
 Route, n
@@ -1037,94 +1037,261 @@
 ent(
-R
+r
 oute
-, new RouteProps().path(%22/%22).component(TodoList.component)),%0A                    
+s)%0A%0A            ),%0A            Document.get().getElementById(%22todoapp%22));%0A    %7D%0A%0A    @Override%0A    public void onModuleLoad() %7B%0A%0A        //React Router now requires that you only create the Routes once so define them statically%0A        routes.push(
 Reac
@@ -1341,19 +1341,8 @@
 h(%22/
-:nowShowing
 %22).c
@@ -1374,133 +1374,128 @@
 nt))
-%0A%0A            ),%0A            Document.get().getElementById(%22todoapp%22));%0A    %7D%0A%0A    @Override%0A    public void onModuleLoad() %7B
+);%0A        routes.push(React.createElement(Route, new RouteProps().path(%22/:nowShowing%22).component(TodoList.component)));
 %0A%0A  

Fix issue #1 - Warning: [react-router] You cannot change ; it will be ignored