Open kiang opened 9 years ago
It structures it like so:
components/Articles components/articles/View
rather than using Index, though that would be a nice option. I'd be open to a pull request.
with the routes like
router(require,
route('home', '/',
route('sub')
),
route('articles',
route('view')
)
);
The button
<Button onTap={() => this.router().transitionTo('articles')}>
returned error messages: Error: Invariant Violation: Cannot find a route named "articles"
I believe you'd need articles to be inside of home:
router(require,
route('home', '/',
route('articles',
route('view', '/articles/:id')
)
),
);
Which would give you /articles and /articles/1
I'm kind of confused of how to have a tree structured routes, can you put out some examples of it?
I have made a button in sub route, <Button onTap={() => this.router().transitionTo('sub1')}> Go to sub1 view
The url changes, but the page doesnt c
router(require, route('home', '/', route('sub', route('sub1') ) ) );
my file structure
app -- components ---- home ------ sub.jsx ------ home.jsx ------ sub -------- sub1
I don't understand this router at all:
Warning: No route matches path "/". Make sure you have
somewhere in your routes
router(require,
route('auth', '/foo'),
route('home', '/',
route('sub')
)
);
Just want to organize folder structure and willing to be reflected in routes. Like...
components/articles/Index.jsx => /articles/index components/articles/View.jsx => /articles/View
The snippet I've tried not working as expected: