Comments (3)
π I feel like children
should be reserved for JSX because thatβs what you can put inside <Component>...</Component>
.
from react-broadcast.
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.
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)
- Use the special string only for context key HOT 4
- Subscriber optional context HOT 1
- Subscriber rendered outside of context of a Broadcast but inside of another Broadcast for a different concern HOT 2
- Make API less verbose HOT 1
- Add <Subscriber quiet> prop to avoid invariant when rendered out of context HOT 1
- Remove React.Children.only restriction in <Broadcast> HOT 1
- RFC: Add support for changing <Subscriber channel>? HOT 1
- Can you add a license for this project
- Updating from the outside HOT 3
- Multiple values (channel) for the same Provider (Broadcast) HOT 2
- createContext: uid clash when developing npm linked packages HOT 2
- Changelog? HOT 1
- Is it still Actual as react new similar context api available
- Is it worth to mark library as deprecated? HOT 2
- There is no possible to work with two differnt components..
- Allow <Subscriber> to render out of context? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-broadcast.