I am trying to rectify the router Simplified example to explain my question (below the post): < / P>
View1
var View1 = React.createClass ({statics: {HeaderAction: function () {this.handleSomething ();}}, Some handle: function () {this.setState (...);}, render: function () {return ( (...) & lt; / div & gt;);}} ); Similar class for View2
app
var app = response .createclass ({rendere : Function () {Returns ( & lt; AppHeader / & gt; & lt; roothandler / & gt; & lt; / div & gt;);}}); Different routes = (& lt; Root name = "app" path = "/" handler = { App)} & gt; & Lt; Root name = "View 2" handler = {view 2} /> gt; & Lt; DefaultRoute handler = {view1} /> & Lt; / Root & gt;); Router.run (route, function (handler) {response.reader (& lt; handler / & gt; document.body);}); I want AppHeader to be in an app-class (not in personal view), because the header / toolbar is always visible if this view is a part of the square, every time the router Each view will be mounted again once a different view is opened. However, things may vary for the component that is active. Due to some (state changes) in view of an icon with a different title, and a clickable action
I have tried to find a good way to solve it, which means that the different prop for the app header is the active square handler because the viewing class happens, so I Thoughts of viewing components (see 1 / View 2 in the example above) were thought, even if it is not used in that type of component. I have seen it in the form of stability in those components, and then tried to remove them in the router. Runt, with that problem, I can not call event handlers in the same component (like View 1 in the example), for something like seeing clickable links for the header.
I tried a reflex store and updated the component as a visual component, call some action on the store, which is heard in app component and it is sent as a support Header However, for the first rendering, that action is called during the render processing of the app contact, due to which the first header propos are not visible because they are not yet available.
Another approach that I thought was a reflex store per view (per router handler), and prop up for the headers in different stores and pass them to the header in appcontent. But then I need to switch between storage, which is active on the route. I have not found any way to store any handler separately besides selecting a store with a redclass router.
Not sure if this helps, & Lt; Link & gt; to reaction-router
.
render () {to_obj = {pathname: category.url, query: {text: category.text}} & lt; Link = = {to_obj} className = "cat-link" & gt; .....
Then at destination, I via a reactivivir
globalstate.tit.set (this.prop. location.query. Text)
I have not tried to do this, but you may also be able to close the function / handler below.
Just one thought.
No comments:
Post a Comment