From 38df5818214d3dfc584e6415c00f30d8774ddd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Sat, 16 Jun 2018 22:59:36 +0200 Subject: [PATCH] Add example. --- .eslintignore | 1 + .gitignore | 2 +- example/.babelrc.js | 1 + example/app.js | 42 ++++++++++++++++++++++++++++++++++++++++++ example/frame.html | 10 ++++++++++ example/frame.js | 23 +++++++++++++++++++++++ example/index.html | 31 +++++++++++++++++++++++++++++++ example/package.json | 25 +++++++++++++++++++++++++ 8 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 example/.babelrc.js create mode 100644 example/app.js create mode 100644 example/frame.html create mode 100644 example/frame.js create mode 100644 example/index.html create mode 100644 example/package.json diff --git a/.eslintignore b/.eslintignore index ed05d93..962e4d6 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,4 @@ node_modules example/bundle.js +example/frame-bundle.js dist diff --git a/.gitignore b/.gitignore index 00e7a7f..f5e87eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ node_modules /dist /example/bundle.js -/generated-docs.md +/example/frame-bundle.js .eslintcache package-lock.json diff --git a/example/.babelrc.js b/example/.babelrc.js new file mode 100644 index 0000000..d7ccfcd --- /dev/null +++ b/example/.babelrc.js @@ -0,0 +1 @@ +module.exports = require('../.babelrc'); diff --git a/example/app.js b/example/app.js new file mode 100644 index 0000000..6daaae5 --- /dev/null +++ b/example/app.js @@ -0,0 +1,42 @@ +/* eslint-env browser */ +/* eslint-disable jsx-a11y/label-has-for */ +import React from 'react'; +import ReactDOM from 'react-dom'; + +class MainApp extends React.Component { + constructor(props) { + super(props); + + this.state = { + large: true, + }; + + this.handleChange = this.handleChange.bind(this); + } + + handleChange(event) { + this.setState({ + large: event.target.checked, + }); + } + + render() { + return ( +
+

+ + +

+