The edit function destructures both attributes (current values) and setAttributes (updater function) from props. This provides read and write access to block data within the editing interface.
Connect RichText component to attributes by setting its value prop to the attribute value and its onChange prop to a function that calls setAttributes with updated content.
The setAttributes function accepts an object with attribute names as keys and new values as values. This updates the block’s data in post state, triggering re-renders and enabling save functionality.