jsx html元素内的花括号是什么?

我遇到了具有以下语法的代码示例:

function createListing(groups,classname) {

    const sharedProps = {
      title: (
        <InfoButton
          classname="margin-left-1"
          data-qa={"info-button"}
        >
          {target => (
            <Toooltip
              placement="bottom"
              target={target}
            >
              {toolTipText}
            </Tooltip>
          )}
        </InfoButton>
      )
    }

      <ItemBlock key={group.title} {...sharedProps}>
        Not Available
      </ItemBlock>
}

我不太了解{target => ()}部分正在发生的事情。在<InfoButton />内部传递的目标变量是什么。我在Google上搜索了此内容,但找不到对该语法的引用。有人可以解释它是什么还是提供进一步阅读的链接?

chengnuo2020 回答:jsx html元素内的花括号是什么?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3113281.html

大家都在问