• Resolved Sridhar Katakam

    (@srikat)


    Hi. I am new to WordPress block development.

    The Edit() in edit.js is a React component and its name follows the standard UpperCamelCase or PascalCase convention.

    Why is it not the same for save() inside save.js?

    https://learn.wordpress.org/lesson/what-does-create-block-generate/ refers to Edit() as a component and save() as a function. But from what I see, save() is also a function, exports JSX and seems to be a component.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Thread Starter Sridhar Katakam

    (@srikat)

    Got this reply from an experienced dev:

    Naming is hard in engineering.. I doubt there’s any specific reasoning here..

    It could’ve been related to early blocks though, I have a feeling it didn’t always return a WP.Element instance, I think there was a time it simply returned a map of paramters

Viewing 1 replies (of 1 total)

The topic ‘Edit() and save()’ is closed to new replies.