Skip to content
Snippets Groups Projects
Commit 20110d8d authored by Max Ramsay King's avatar Max Ramsay King
Browse files

react app stuff

parent df39cc2d
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 29 deletions
No preview for this file type
File added
'use strict';
import React from 'react';
import ReactDOM from 'react-dom';
const e = React.createElement;
console.log('hello')
class LikeButton extends React.Component {
constructor(props) {
super(props);
this.state = { liked: false };
}
render() {
if (this.state.liked) {
return <p>'You liked this.'</p>;
}
return e(
'button',
{ onClick: () => this.setState({ liked: true }) },
'Like'
);
}
}
const domContainer = document.querySelector('#like_button_container');
const root = ReactDOM.createRoot(domContainer);
root.render(e(LikeButton));
\ No newline at end of file
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment