Skip to content

Instantly share code, notes, and snippets.

@valex
valex / index.html
Created October 20, 2018 18:37
Change state outside component
<!DOCTYPE html>
<html>
<head>
<title>State</title>
<style>
body, textarea {
font-family: Courier;
}
</style>
</head>
@valex
valex / index.html
Created October 20, 2018 16:11
State component
<!DOCTYPE html>
<html>
<head>
<title>State</title>
<meta charset="utf-8">
<style>
body, textarea {
font-family: Courier;
}
</style>
@valex
valex / index.html
Created October 20, 2018 15:57
Stateless component
<!DOCTYPE html>
<html>
<head>
<title>Stateless</title>
<meta charset="utf-8">
<style>
body, textarea {
font-family: Courier;
}
</style>
@valex
valex / index.html
Created October 20, 2018 14:45
Component PropTypes and defaultProp
<!DOCTYPE html>
<html>
<head>
<title>propTypes</title>
<meta charset="utf-8">
</head>
<body>
<div id="app">
<!-- my app renders here -->
</div>
@valex
valex / index.html
Created October 20, 2018 14:31
Component props
<!DOCTYPE html>
<html>
<head>
<title>Component properties</title>
<meta charset="utf-8">
</head>
<body>
<div id="app">
<!-- my app renders here -->
</div>
@valex
valex / index.html
Created October 20, 2018 13:39
React.createElement for span
<!DOCTYPE html>
<html>
<head>
<title>Custom component</title>
<meta charset="utf-8">
</head>
<body>
<div id="app">
<!-- my app renders here -->
</div>
@valex
valex / index.html
Created October 20, 2018 13:36
Custom Component. React.createFactory
<!DOCTYPE html>
<html>
<head>
<title>Custom component</title>
<meta charset="utf-8">
</head>
<body>
<div id="app">
<!-- my app renders here -->
</div>
@valex
valex / index.html
Created October 20, 2018 13:36
Custom Component. React.createElement
<!DOCTYPE html>
<html>
<head>
<title>Custom component</title>
<meta charset="utf-8">
</head>
<body>
<div id="app">
<!-- my app renders here -->
</div>
@valex
valex / index.html
Created October 20, 2018 13:07
React Hello World
<!DOCTYPE html>
<html>
<head>
<title>hello React</title>
<meta charset="utf-8">
</head>
<body>
<div id="app">
<!-- my app renders here -->
</div>
@valex
valex / index.html
Created September 30, 2018 12:42
Add sound sources to your scene
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js misc - sound</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
background-color: #000000;
margin: 0px;