andreypopp / react-macros

A set of syntax extensions for React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-macros

A set of syntax extensions for React:

  • component Name { ... } for component definition
  • mixin Mixin directive
  • prop name type for prop definition
  • >propName and @stateKey accessors for component properties and state

Example:

component Button {

  mixin SomeMixin

  prop caption required string
  prop active bool
  prop onClick func

  render() {
    return React.DOM.div({onClick: this.onClick}, >caption);
  }
}

About

A set of syntax extensions for React


Languages

Language:JavaScript 100.0%