Skip to content

Drop PropTypes requirement, Add option for attribute typing

Pre-release
Pre-release
Compare
Choose a tag to compare
@janebitovi janebitovi released this 09 Sep 18:11
· 100 commits to main since this release

Features:

  • Add option for specifying attribute types so it will automatically be converted from the string to the appropriate type. (Number, Object, Function, ref, etc) #50
  • Remove PropTypes requirement
  • Ensure preact 10 is supported (all tests run against preact 10 too now)
  • Begin convert to TypeScript
    • NOTE: use // @ts-ignore on the line before calling reactToWebComponent() to disable type checking if you're in a TS environment. Typing will be implemented properly before stable release.

Example ignoring TS if you want to start using this alpha release:

customElements.define(
  "react-counter",
  // @ts-ignore
  reactToWebComponent(Counter, React, ReactDOMClient, {...})
);

Bug Fixes:

  • None

Other:

  • Test improvements / fixed intermittently failing tests
  • Update docs to use functional components in the examples