ReactJS Simple Component
How do I make an reactjs simple component?
What is a reactjs simple component? How do you make a reactjs simple component? This script and codes were developed by Xavier Martínez on 19 September 2022, Monday.
ReactJS Simple Component - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>ReactJS Simple Component</title>
</head>
<body> <div id="app"></div> <script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/react/15.3.1/react-dom.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/react/0.13.0/react.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
ReactJS Simple Component - Script Codes JS Codes
'use strict';
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var App = function (_React$Component) { _inherits(App, _React$Component); function App() { _classCallCheck(this, App); var _this = _possibleConstructorReturn(this, _React$Component.call(this)); _this.state = { val: 0, on: true }; _this.clicked = _this.clicked.bind(_this); return _this; } App.prototype.clicked = function clicked() { console.log('click!'); this.setState({ val: this.state.val + 1 }); }; App.prototype.render = function render() { return React.createElement( 'div', null, React.createElement( 'h1', null, 'Hello, ', this.props.name ), React.createElement( 'p', null, 'Click me!' ), React.createElement( 'button', { onClick: this.clicked }, this.state ), React.createElement( 'p', null, 'You clicked me ', this.state.val ) ); }; return App;
}(React.Component);
React.render(React.createElement(App, { name: 'Peter' }), document.getElementById('app'));
Developer | Xavier Martínez |
Username | xmjol |
Uploaded | September 19, 2022 |
Rating | 3 |
Size | 2,540 Kb |
Views | 22,264 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Flex Side-content-2 | 2,414 Kb |
A beautiful day | 2,973 Kb |
React UI - 04 Steps Form | 4,906 Kb |
4-block-flex Round | 3,301 Kb |
React UI - 07 - Random Image Generator Giphy API | 4,193 Kb |
SVG Business Card | 3,661 Kb |
React UI - 01 - Voting System | 4,796 Kb |
Let | 2,699 Kb |
React UI - 03 - CardList | 8,219 Kb |
Flex Side-content | 2,952 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
12 DAYS OF XMAS | Proto78 | 2,313 Kb |
CSS Chat Bubbles | Boylett | 2,094 Kb |
Magnus 3 | ARocketfish | 7,944 Kb |
Gears | Synvox | 3,278 Kb |
Heatmap Color Scales | Stevepepple | 2,331 Kb |
Multicolumns 2 | Raphaelgoetter | 1,857 Kb |
Add This API | ThatGuySam | 2,848 Kb |
Knob rotation | Alemesre | 2,122 Kb |
Material design - button rainbow circle | Kunukn | 3,652 Kb |
Using Flickr API | MoyArt | 6,761 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!