Get the current block ID

The block id is saved in the clientId field. It’s regenerated at each save of the post and is only available in props in the edit function. In order to use this field as unique id in the save function, it needs to be saved as attribute in the edit section. It will be then available in the save function via props.attributes.

Leave a Comment