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 React from "react"; | |
export default function withCounter(Component) { | |
return class extends React.Component { | |
constructor() { | |
super(); | |
this.state = { | |
count: 0, | |
}; |
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 { useCounter } from '../hooks'; | |
export default function CounterWithHooks({ count, increment, decrement }) { | |
return ( | |
<> | |
<p>Count: {count}</p> | |
<button type="button" onClick={increment} /> | |
<button type="button" onClick={decrement} /> | |
</> | |
) |
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 React from 'react'; | |
export default function useCounter() { | |
const [count, setCount] = React.useCounter(0); | |
function increment() { | |
setCount(count + 1); | |
} | |
function decrement() { |
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
[test]: Update test/* files | |
[dist]: Changes to submodules, version bumps, updates to package.json | |
[minor]: Small changes | |
[doc]: Updates to documentation | |
[fix]: Bug fixes | |
[bin]: Update binary scripts associated with the project | |
[refactor]: Refactor of existing code | |
[nit]: Small code review changes mainly around style or syntax | |
[feat]: New features |
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
"editor.tokenColorCustomizations": { | |
"[LaserWave Italic]": { | |
"textMateRules": [ | |
{ | |
"scope": [ | |
"comment.block", | |
"comment.line.double-slash.js.jsx", | |
"comment.line" | |
], | |
"settings": { |
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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import _ from 'lodash'; | |
import shortid from 'shortid'; | |
const App = () => { | |
const experiment = n => console.log(n); | |
return ( | |
<h1> |
NewerOlder