#678·preact

Checking `prop in elem` fails with deferred custom element definitions

Author: treshugartCreated Apr 27, 2017Updated Aug 5, 2026

Reproduction: https://www.webpackbin.com/bins/-KikMSw9W7D7EHbuTdTX

Context: Skate is using Preact under the hood to render, so h is just a straight export of Preact's h in that bin. val is a function that ensures props are explicitly set all of the time. Another way to work around the check here would be to use a ref and imperatively set the prop.

I spoke with @developit and the proposed solution is to always set props for anything that isn't a string or number, while continuing the prop in elem check. However, I'm not sure the in check is still necessary after implementing something like this.