#Recompose Workshop
##Stateless Function Components
Review stateless function components
- best way to code markup
- they take an object props, as their first arg, and context as second
- they return jsx
- they have no state...
#Recompose Workshop
##Stateless Function Components
Review stateless function components
| import { INCREMENT_COUNTER, DECREMENT_COUNTER } from '../constants/ActionTypes'; | |
| export default (state = 0, action) => ({ | |
| [actions.increment]: (state )=> state + 1, | |
| [actions.decrement]: (state) => state - 1, | |
| default: state => state | |
| }[action.type || 'default'](state, action.payload)) |
| require('babel-polyfill'); | |
| var uuid = require('uuid'); | |
| var faker = require('faker'); | |
| var Benchmark = require('benchmark'); | |
| var suite = new Benchmark.Suite; | |
| var chunkify = require('chunkify'); | |
| const createFakeArray = range => { | |
| const arr = []; | |
| for (let i = 0; i < range; i ++) { |
| import React, { useState, useEffect, useRef, createContext, useContext } from 'react'; | |
| // Wizard Context | |
| const WizardContext = createContext(); | |
| // Wizard Root Component | |
| const WizardRoot = ({ children, onPageChange }) => { | |
| const [currentPage, setCurrentPage] = useState(0); | |
| const [totalPages, setTotalPages] = useState(0); | |
| const formRef = useRef(null); |
This guide covers setting up external access to your homelab services through Cloudflare Tunnels, with Authelia providing single sign-on protection. The end result: you can access sonarr.yourdomain.com from anywhere, protected by 2FA, without opening any ports on your router.
Internet → Cloudflare → cloudflared container → Traefik → Authelia check → Your service