built_react 0.1.1
built_react: ^0.1.1 copied to clipboard

Simple typesafe dart react

built-react #

Simple typesafe dart react.

Usage #

A simple usage example:

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script defer src="packages/react/react.js"></script>
    <script defer src="packages/react/react_dom.js"></script>
    <script defer src="main.dart.js"></script>

<div id="react">Loading...</div>
import 'package:built_react/built_react.dart';

part 'main.g.dart';

abstract class AppProps implements BuiltSimple, Props {
  factory AppProps([BuilderFunc<AppPropsBuilder> b]) => _AppProps(b);
  String get text;

class App extends Component {
  AppProps get props => super.props;

  App([BuilderFunc<AppPropsBuilder> b, List<RenderResult> c]) : super(AppProps(b), c);

  RenderResult render() {
    return Dom.div(
        (b) => b
          ..on.click = ((e) => window.alert(''))
          ..style.position = PositionValue.fixed
          ..style.right = Size.px(100)
          ..style.top = Size.px(100),

main() {
  render(App((b) => b..text = 'Hello world!'), '#react');

License #


Features and bugs #

Please file feature requests and bugs at the issue tracker.