Update block API docs with edit/save argument as props #363
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related: #335
Related: #327 (comment)
This pull request seeks to update API docs for blocks to account for changes in
edit
andsave
function argument signature in the blocks API. These property values are now treated as components, acceptingprops
if defined as a function (optionally defined as awp.element.Component
class).Open questions:
edit
,save
accepting a single object vs.encodeAttributes
and control'sonClick
,isActive
obvious enough? The latter set of functions have not yet been implemented and are subject to change, but it's not likely they'll be ever be considered as components likeedit
andsave
.block
, thoughprops
is more accurate (should we shield developers from this terminology?).On the up-side, passing block/props/options as a single object argument allows us to room to grow if we decide we need to pass more behaviors to the block render.