Uploaded image for project: 'Magnolia Frontend Helpers'
  1. Magnolia Frontend Helpers
  2. MGNLFE-560

Support another way to share data between components

    XMLWordPrintable

Details

    • Story
    • Resolution: Fixed
    • Neutral
    • 1.6
    • None
    • None
    • None
    • DevX 44, DevX 45
    • 5
    • Yes

    Description

      Besides react built-in context (React.createContext()), supports another way by using a global singleton that can share data between components:

      • Consider moving unchanged data in 1 js singleton (componentMappings, fallbackComponent, devMode)
      • And easy changed data in another js (content from page, templateAnnotations)

       

       

      AC: Check and update all sample spa project that used EditorContext.js

       

      Reference code: ComponentConfig.js, ContextSingleton.js from propsal PR: https://git.magnolia-cms.com/projects/MODULES/repos/frontend-helpers/pull-requests/220/diff#samples/next-js-13-with-react-editor-new/packages/react-editor-2/src/utils/ContextSingleton.js

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                plequoc Phong Le Quoc
                oanh.thai Oanh Thai Hoang
                DeveloperX
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Work Started:

                  Checklists

                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Remaining Estimate - 0d
                      0d
                      Logged:
                      Time Spent - 5d 1h
                      5d 1h