最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

block editor - Pass propsfunction to InnerBlocks

programmeradmin0浏览0评论

I have a situation where i want to pass props to InnerBlocks just like I would be able to pass props to child components. The situation is, that I have a parent block that has a function to update its height, based on some InnerBlocks and their content / settings.

I want to call that function, when a user clicks the child block.

e.g.

<div onClick={ parent.updateHeight }> content </div>

How can that be achieved? I know that parent and child attributes are accessible with select calls but can I also pass functions?

发布评论

评论列表(0)

  1. 暂无评论