Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programattic createRoute error #1272

Closed
jannavarro opened this issue Jun 5, 2015 · 5 comments
Closed

Programattic createRoute error #1272

jannavarro opened this issue Jun 5, 2015 · 5 comments

Comments

@jannavarro
Copy link

I did the workaround stated in #887 but I get an error of ReactDefaultInjection.js: Uncaught TypeError: type.toUpperCase is not a function. I just want to ask for guidance if there is something I need to correct in the ff because I tried different approaches already.

--MainRoute.jsx
import App from "../../app0";
import Login from "../auth/login"

var MainRoute = Router.createRoute({
handler: {App}
});

Router.createRoute({
name: "login",
parentRoute: MainRoute,
handler: {Login},
isDefault: true
})

export {MainRoute}

--Index.jsx
import {MainRoute} from "./modules/routes/AuthRoute"
//some code
Router.run([MainRoute], function (Handler, state) {
      React.render(
        <Handler  cursor={data} statics={state} />, document.body);
    });
@jannavarro
Copy link
Author

I added the code here so it can be repro. The index.js contains the code with error and below that there is a commented equivalent code that is not the programattic way but is working.

@mjackson
Copy link
Member

createRoute is gone in the 1.0 API (current master). You can use plain js objects instead.

@eriknyk
Copy link

eriknyk commented Jun 24, 2015

did you @jannavarro solved this issue anyway?

Regards.

@gryzzly
Copy link

gryzzly commented Nov 2, 2015

@mjackson how does one define RedirectRoute with plain JS objects in 1.0? Thanks!

@knowbody
Copy link
Contributor

knowbody commented Nov 2, 2015

@gryzzly see #2256

@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants