Skip to content

defaultProps and Component support

Compare
Choose a tag to compare
@dntzhang dntzhang released this 05 Nov 01:44
· 447 commits to master since this release
  • WeElement and Component are the same.
  • Supports defaultProps
define('my-first-element', class extends WeElement {
  static defaultProps = {
		name: 'Omi',
		myAge: 18
	}

  render(props) {
    return (
      <h1>Hello, {props.name}! Age {props.myAge}</h1>
    )
  }
})