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

Code example in react-editor README is incorrect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Neutral
    • 1.0.1
    • None
    • None
    • None

    Description

      In https://git.magnolia-cms.com/projects/MODULES/repos/frontend-helpers/browse/packages/react-editor

      This is used:

      const pageConfig = {templateDefinitions: templateDefinitions, componentMappings: COMPONENTS_MAPPING}
      
         return(
            <EditablePage content={content} config={pageConfig} />
         );
      

      But the approach to put templateDefinitions into the config object was in the end not included, templateDefinitions should not be in the pageConfig, it should just be included as a prop directly in `< EditablePage .......... />`. 

      This README sample should be updated in order to avoid confusion and errors.

      const pageConfig = {componentMappings: COMPONENTS_MAPPING} 
      
      return( <EditablePage content={content} config={pageConfig} templateDefinitions={templateDefinitions} /> );
      

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                rsiska Robert Šiška
                czimmermann Christopher Zimmermann
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD