Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-12018

CmsPage component in SPA React SDK should accept children as a prop

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • 13.4.0
    • 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).

      Attachments

        Activity

          People

            Unassigned Unassigned
            mdenburger Mathijs den Burger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: