Skip to content

Instantly share code, notes, and snippets.

View indreklasn's full-sized avatar
👋

Trevor I. Lasn indreklasn

👋
View GitHub Profile
import React from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
VrButton
} from 'react-360';
// The connectedCallback() runs each time the element is added to the DOM
connectedCallback() {
this.style.border = 'solid 1px #333'
this.style.padding = '10px 20px'
}
class WebComponentButton extends HTMLElement {
// The connectedCallback() runs each time the element is added to the DOM
connectedCallback() {}
// Called every time the element is removed from the DOM. Useful for running clean up code.
disconnectedCallback() {}
//When the element is either removed from the DOM, or moved to a different page:
adoptedCallback() {}
class WebComponentButton extends HTMLElement {
constructor() {
super()
this.addEventListener('click', () => {
console.log('click')
})
}
}
class WebComponentButton extends HTMLElement {
constructor() {
super()
this.addEventListener('click', () => {
console.log('click')
})
}
}
customElements.define(name, constructor, options);
const add = (...nums) => {
return nums.reduce((total, num) => total + num);
}
add(1, 2, 3); // 6
console.log('Hello, World')
public class HelloWorld {
public static void main(String[] args) {
// Prints "Hello, World" to the terminal window.
System.out.println("Hello, World");
}
}
yarn add react react-dom && yarn start