jsonnull / redux-render

Ergonomic Redux bindings for React using render functions
MIT License
54 stars 3 forks source link

add render prop #2

Closed kevinwolfcr closed 5 years ago

kevinwolfcr commented 6 years ago

Hello! I am using this library on an open source project I am working on eoscostarica/dmeetup

The prop render has become a standard when using children as a function. So I think this package can be updated to support this convention.

<Redux
  selector={state => state}
  render={(state) => <pre>{JSON.stringify(state, null, 2)}</pre>} />
jsonnull commented 6 years ago

Hello and sorry for the late reply!

I've seen most projects standardize on using children over render. One reason for this is that it affords you additional flexibility—you can use the children-as-function syntax or the prop syntax, however you prefer. For this reason, I don't see a huge benefit in making the change to use render instead of children.

kevinwolfcr commented 6 years ago

Well, we can also leave it to user's call. Just like react-router does.

jsonnull commented 6 years ago

Sure, that's worth considering.