0.8.2 • Published 6 years ago

react-dou v0.8.2

Weekly downloads
19
License
MIT
Repository
github
Last release
6 years ago

React Dou

CircleCI TypeScript react-dou style: styled-components code style: prettier

Install

yarn add react-dou react react-dom styled-components # @types/react @types/react-dom @types/styled-components

Example

by DouFunctionsConsumer

(
  <DouProvider callback={callback}>
    <DouFunctionsConsumer>
      {({ask}) => {
        return (
          <button onClick={ask('ハンバーガー食べますか?')}>ハンバーガー食べますか?</button>
        );
      }}
    </DouFunctionsConsumer>
    <Dou />
  </DouProvider>
)

by withDou

interface Props {
  text: string;
}

class IComponent extends React.Component<
  Props & Partial<DouFunctionsProps>,
  {a: string}
> {
  // @ts-ignore
  props: Props & DouFunctionsProps
  
  render() {
    return (
      <button onClick={this.props.dou.ask('message')}>{this.props.text}</button>
    );
  }
}

const IComponentWithDou = withDou<Props>(IComponent);

References

License

MIT

0.8.2

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.7.2

6 years ago

0.7.1

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.3

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago