1. imr : import React from 'react'
2. imrd: import ReactDOM from 'react-dom'
3. imrc: import React, { Component } from 'react'
4. rcc: add react class based component code
5. rfc: add react functional component code
6. est: add state to the component
7. sst: add this.setState call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://itnext.io/under-the-hood-of-react-hooks-805dc68581c3 | |
// Engine | |
const React = { | |
index: 0, | |
state: [], | |
useEffect: (callback, dependencies) => { | |
const cachedIndex = React.index; | |
const hasChanged = dependencies !== React.state[cachedIndex]; | |
if (dependencies === undefined || hasChanged) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express from 'express'; | |
import { readdirSync, lstatSync, readFileSync } from 'fs'; | |
import {basename, join, dirname, sep } from 'path'; | |
const PORT = process.env.PORT || 5000; | |
const app = express(); | |
let startFolder = null |
OlderNewer