Giter Site home page Giter Site logo

Comments (3)

j-f1 avatar j-f1 commented on May 9, 2024 1

πŸ‘ I feel like children should be reserved for JSX because that’s what you can put inside <Component>...</Component>.

from react-broadcast.

fatfisz avatar fatfisz commented on May 9, 2024

I'd compare using function in children to using thunks in Redux - you don't get the actual child, but something that you can call to get the child.
In this sense it's natural that there cannot be any other child other than the one between the tags, whereas with the render prop it feels (IMO) like a second API to do the same thing, just like the explicit children prop (i.e. <Compo children={something} />).

I think using function-as-children shouldn't feel any different from using thunk-as-action. On the other hand, not everyone fancies Redux πŸ˜‰

from react-broadcast.

mjackson avatar mjackson commented on May 9, 2024

I think we'll just leave it at children for now. That's sort of the universally expected "render prop".

from react-broadcast.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.