jaspr_hooks 0.1.0 copy "jaspr_hooks: ^0.1.0" to clipboard
jaspr_hooks: ^0.1.0 copied to clipboard

React-style lifecycle and state hooks for native Jaspr components.

example/example.md

jaspr_hooks example #

This directory contains the static Jaspr Content documentation site and its live, client-island hook demos. The same small counter pattern used throughout the docs can be embedded in any Jaspr application:

import 'package:jaspr/dom.dart';
import 'package:jaspr/jaspr.dart';
import 'package:jaspr_hooks/jaspr_hooks.dart';

class Counter extends HookComponent {
  const Counter({super.key});

  @override
  Component build(BuildContext context) {
    final count = useState(0);

    return button(
      onClick: () => count.value++,
      [text('Count: ${count.value}')],
    );
  }
}

Run the site from this directory with jaspr serve. A production static build uses the configured /jaspr_hooks/ base path for GitHub Pages.

1
likes
0
points
278
downloads

Documentation

Documentation

Publisher

verified publishercodegrowers.tech

Weekly Downloads

React-style lifecycle and state hooks for native Jaspr components.

Repository (GitHub)
View/report issues

Topics

#jaspr #hooks #web #state-management #server-side-rendering

License

unknown (license)

Dependencies

jaspr, universal_web, web

More

Packages that depend on jaspr_hooks