We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Last one I promise :)
This one is really a matter of opinion, but I think rendering to this.props.children instead of a "render" prop makes things a little cleaner.
The React docs describe using this method: https://reactjs.org/docs/render-props.html#using-props-other-than-render
Just my 2¢
// CURRENT <FirestoreCollection path="stories" sort="publishedDate:desc,authorName" render={({ isLoading, data }) => { return isLoading ? ( <Loading /> ) : ( <div> <h1>Stories</h1> <ul> {data.map(story => ( <li key={story.id}> {story.title} - {story.authorName} </li> ))} </ul> </div> ); }} /> // PROPOSED <FirestoreCollection path="stories" sort="publishedDate:desc,authorName"> {({ isLoading, data }) => { return isLoading ? ( <Loading /> ) : ( <div> <h1>Stories</h1> <ul> {data.map(story => ( <li key={story.id}> {story.title} - {story.authorName} </li> ))} </ul> </div> ); }} </FirestoreCollection>
The text was updated successfully, but these errors were encountered:
@sampl - I'd be happy to accept a PR that adds the children prop as another valid rendering method!
children
Sorry, something went wrong.
OK! I'll take a stab at it, stay tuned 😃
0c3be00
No branches or pull requests
Last one I promise :)
This one is really a matter of opinion, but I think rendering to this.props.children instead of a "render" prop makes things a little cleaner.
The React docs describe using this method: https://reactjs.org/docs/render-props.html#using-props-other-than-render
Just my 2¢
The text was updated successfully, but these errors were encountered: