Skip to content

Instantly share code, notes, and snippets.

View Violet-Bora-Lee's full-sized avatar
💜
I code, build and act.

Bora Lee Violet-Bora-Lee

💜
I code, build and act.
View GitHub Profile
// in util.js
export default function times(x) {
return x * x;
}
// in app.js
import k from './util.js';
console.log(k(4)); // returns 16
import { times, plusTwo } from './util.js';
console.log(times(2));
console.log(plusTwo(3));
export function times(x) {
return x * x;
}
export function plusTwo(number) {
return number + 2;
}
export default function times(x) {
return x * x;
}
export default App;
import React, { Component } from 'react';
const HelloWorld = ({ hello }) => {
return <h1>{hello}</h1>;
}
const HelloWorld = (props) => {
return <h1>{props.hello}</h1>;
}
reactFunction = () => {
const { name, email } = this.state;
};
//index.js file
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
ReactDOM.render(<App />, document.getElementById('root'));