• Forgive me if this is a dumb question, I’m still pretty new to all this.

    I am trying to create a custom block using flatpickr, which requires me to wait for an element to be mounted and either pass the actual DOM Node or an id/classname into the flatpickr constructor. Searching the docs and code, I didn’t find any way of accessing a ‘mounted’ hook in a block type.

    I then found this issue, in which it was suggested to use wp.element.Component and the React API. Looking at the code for it, it does appear in fact to simply expose the native React Component. Since the docs treat element as an abstraction over React (and I think for good reason), is it safe to assume that as wordpress develops, the element library will be committed to exposing a Component API just like React’s in the near future? Can I depend on this for my plugin?

    Some built-in blocks such as button do in fact use this method.

    • This topic was modified 6 years, 5 months ago by pixelrobin. Reason: Title clarification

    The page I need help with: [log in to see the link]

  • The topic ‘Custom Blocks: Is wp.element.Component “finalized”?’ is closed to new replies.