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

Code example in react-editor README is incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Neutral Neutral
    • 1.0.1
    • None
    • None
    • None
    • HL & LD 1
    • 0.5

      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} /> );
      

        Acceptance criteria

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

                Created:
                Updated:
                Resolved: