Answers for "React setup for handling UI."

1

React setup for handling UI.

$ npm install onsenui react-onsenui --save
Posted by: Guest on January-03-2021
0

React setup for handling UI.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8" />
  <link rel="stylesheet" href="css/onsenui.css">
  <link rel="stylesheet" href="css/onsen-css-components.css">
  <script src="react.js"></script>
  <script src="react-dom.js"></script>
  <script src="onsenui.js"></script>
  <script src="react-onsenui.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/6.1.19/browser.min.js"></script>
</head>

<body>
  <div id="app"></div>

  <script type="text/babel">
    var App = React.createClass({
      handleClick: function() {
        ons.notification.alert('Hello world!');
      },

      render: function() {
        return (
          <Ons.Page>
            <Ons.Button onClick={this.handleClick}>Tap me!</Ons.Button>
          </Ons.Page>
        );
      }
    });
    ReactDOM.render(<App />, document.getElementById('app'));
  </script>
</body>
</html>
Posted by: Guest on January-03-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language