Skip to content

Releases: bitovi/react-to-web-component

Fix method transforms when shadow DOM is used

Choose a tag to compare

This release fixes an error with the method property transform when used with Shadow DOM.

See #231 for more details.

Fix method transforms when shadow DOM is used

Choose a tag to compare

This release fixes an error with the method property transform when used with Shadow Dom

See #231 for more details.

Add method property converter.

Choose a tag to compare

see #221 for more on the method prop type.

Note that unlike other converters, there's no string equivalent for this prop converter, so it is meant for use only as direct properties of the element object, not as attributes.

Add method property converter.

Choose a tag to compare

see #221 for more on the method prop type.

Note that unlike other converters, there's no string equivalent for this prop converter, so it is meant for use only as direct properties of the element object, not as attributes.

Add React 19 to available peerDependencies

Choose a tag to compare

Our test suite passes with React 19 so we've added it to the available peerDependencies.

Add React 19 to available peerDependencies

Choose a tag to compare

Our test suite passes with React 19 so we've added it to the available peerDependencies.

Change r2wc externals to match react-dom/client

Choose a tag to compare

PR #135 addressed some difficulties and unnecessary React warnings in the browser.

React 18 Support

Choose a tag to compare

This release updates react-to-web-component to support React 18 and removes support for React 16 and 17.

#103

React 16 and 17 are still supported by the legacy version of react-to-web-component (published as react-to-webcomponent on NPM)

2.0.0 Release!

Choose a tag to compare

Simplified API, Typescript support, and more! See https://www.bitovi.com/blog/react-to-web-component-v2 for all the new features.

The API for react-to-web-component is now easier than ever! No more need to pass in React and ReactDOM as they are now treated as peer dependencies. The use of PropTypes has also been replaced with a dedicated props object when creating the Web component. See the example below.

import r2wc from "@r2wc/react-to-web-component"

const WebGreeting = r2wc(Greeting, {props: ["name"] })  // or { props: { name: "string" } }

customElements.define("web-greeting", WebGreeting)

Drop PropTypes requirement, Add option for attribute typing

Choose a tag to compare

@janebitovi janebitovi released this 09 Sep 18:11

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