Skip to content

[labs] Add reactive controller -> hooks adapter to labs #1531

@justinfagnani

Description

@justinfagnani

Some subset of reactive controllers will depend only on the generic ReactiveControllerHost interface and not specifics of that host being a LitElement. These types of controllers can probably be wrapped into React hooks, making them a lower-level primitive for code sharing across frameworks and web components.

To make a hook wrapper we need to create and store a controller instance with useState, trigger the controller lifecycle via the built-in React hooks, and possibly allow mapping any OOP (property/method) APIs on the controller to hook function arguments and return values for more idiomatic hooks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions