- Создать контекст при помощи React.createContext()
- Передать данные (Provider)
- Получить данные (Comsumer)
Демо: codesandbox
| { | |
| "workbench.startupEditor": "none", | |
| "workbench.statusBar.feedback.visible": false, | |
| "window.menuBarVisibility": "toggle", | |
| "workbench.statusBar.visible": false, | |
| "workbench.activityBar.visible": false, | |
| "editor.fontFamily": "JetBrains Mono, Menlo, Monaco, 'Courier New', monospace", | |
| "editor.fontSize": 14, | |
| "editor.fontLigatures": true, | |
| "editor.lineHeight": 24, |
| Open .bashrc file and find line with PS1 variable: | |
| PS1="\n\[\e[48;5;28;1;33m\]❱\[\e[48;5;28;97m\] \A \[\e[48;5;34;38;5;232m\]\[\e[1;33m\]❱\[\e[38;5;232m\] \u@\h \[\e[48;5;30m\]\[\e[1;33m\]❱\[\e[38;5;15m\] \w \[\e[40;1;33m\]❱ \[\e[40;32m\]\[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\n\[\e[1;33m\]❱ \[\e[m\]\[\e[32m\] " |
Демо: codesandbox
node <path-to-jest> -i <you-test-file> -c <jest-config> -t "<test-block-name>"
| const withImages = require("next-images"); | |
| const nextConfig = {...} | |
| module.exports = (phase) => { | |
| if (phase === PHASE_DEVELOPMENT_SERVER || phase === PHASE_PRODUCTION_BUILD) { | |
| const withCSS = require("@zeit/next-css"); | |
| return withCss(withImages(nextConfig))))); | |
| } | |
| return withImages(nextConfig); | |
| }; |
| async function walk(dir) { | |
| let files = await fs.readdir(dir) | |
| files = await Promise.all(files.map(async file => { | |
| const filePath = path.join(dir, file) | |
| const stats = await fs.stat(filePath) | |
| if (stats.isDirectory()) { | |
| return walk(filePath); | |
| } | |
| else if (stats.isFile()) { | |
| return filePath; |