Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Done
-
None
-
None
-
None
-
1
-
Tiger
-
Tiger Sprint 213, Tiger Sprint 214, Tiger Sprint 215
Description
The README in the SPA React SDK states:
Please note that `<CmsPage>` takes children as a function instead of as a prop, because it is not possible to provide state through context providers due to a bug in React currently. So make sure to wrap any children of `<CmsPage>` in a function.
It's unclear which "bug" is being referred to. Having to use a 'render function' to supply the children of CmsPage is odd, and a quick POC suggests that passing the children as a prop is perfectly well possible. We should start supporting this.
Can be implemented backwards compatible: CmsPage can check whether props.children is a function (and then invoke it) or not (and this use it as-is).