JavaScript for WordPress Forums Gutenberg Development isSelected and InspectorControls

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #46245
    meszarosrob
    Participant

    I am watching the “04.07 – Example – Inspector Controls” and when the <InspectorControls> is used in the edit it is used with isSelected

    isSelected && <InspectorControls>

    Now I can’t seem to find this isSelected && … pattern used on the core blocks.

    Can I skip the isSelected? It does seem to work without it. https://github.com/WordPress/gutenberg/blob/master/core-blocks/paragraph/index.js#L161

    #46890
    Zac Gordon
    Keymaster

    That is correct! isSelected is no longer needed for toolbars or inspector controls 🙂

    I will add some notes to the course pages about this next week. Great catch!

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.