reactjs - Relay: Composing child fragments -


with react-router:

<routes>   <route path="/" component={app}>     <route path="about" component={about} />     <route path="help" component={help} />   </route> </routes> 

and in app:

render() {  return (    {this.props.children}   ); } 

if on app container compose fragments of children

${about.getfragment(somefragment)} ${help.getfragment(somefragment)} 

will relay compose fragments given components expressed children {this.props.children} , not instantiated classes , ?

the question using children syntax {this.props.children} work relay's aggregating fragment logic?

that should work, it's not best practice store fragments in highest parent-level component. relay, idea want declare data requirements alongside components instantiated classes. way, know data being fetched graphql server each component, maintaining separation of concerns each component, creating less confusion.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo