Support » Plugin: Gutenberg » wordpress gutenberg validation error on save function

  • Resolved derrida

    (@derrida)


    hey
    so i am playing with wordpress gutenberg block dev. and already made some simple one. now i am trying to make a more complicated one of a slider.
    everything works untill the save function where i get validation error and a bizzare notice about EndTag which i do not get.
    this is my save function , for now i am just trying to save the slides titles. if i console log within the map, i do get what i want.

    	save: function( props ) {
        const { slides } = props.attributes; 
        const id = props.attributes.id;
        
        const displaySlides = slides.map((slide) => {
          return (
            <div>
              <span>{slide.title}</span>
            </div>
          )
        });
    
        return (
          <div>
            {displaySlides}
          </div>
        )
      },
    

    i get 1 – block validation: expected token of type ‘endTag’

    and 2- block validation : block valifation failed for …..then the expected and the actual. by the way, in the actual i do get the right result

    what am i missing here?

Viewing 1 replies (of 1 total)
  • This is because, your html node of edit function didn’t match with save function. Html nodes of those two function need to match for this error to resolve

Viewing 1 replies (of 1 total)
  • The topic ‘wordpress gutenberg validation error on save function’ is closed to new replies.