Remix treats nested routes files differently. Its not simply a flat list of routes. Take this example-
routes
team
index.js
$username.js
team.js
Remix treats nested routes files differently. Its not simply a flat list of routes. Take this example-
routes
team
index.js
$username.js
team.js
| interface Props<TParams> { | |
| params: TParams, | |
| path: string, | |
| children: React.ReactChild, | |
| } | |
| const CustomLink = <TParams extends any>(props: Props<TParams>) => { | |
| const { | |
| path, | |
| params, |
| const { useEffect } = require("react"); | |
| // Suffers from Stale Closures | |
| export function useUpdatedExit(props) { | |
| // initial = 0, latest = 0 | |
| // initial = 0, latest = 1 | |
| // initial = 0, latest = 2 | |
| const { initial, latest, cb } = props; | |
| function handleExit() { |
| function sleep(duration, shouldFail) { | |
| return new Promise((resolve, reject) => { | |
| const cb = shouldFail ? reject : resolve; | |
| setTimeout(() => cb(), duration); | |
| }); | |
| } |
| var videoElem = document.querySelector('video'); | |
| var audioCtx = new AudioContext(); | |
| var source = audioCtx.createMediaElementSource(videoElem); | |
| var gainNode = audioCtx.createGain(); | |
| gainNode.gain.value = 5; | |
| source.connect(gainNode); | |
| gainNode.connect(audioCtx.destination); |
| function Actor({ name }) { | |
| function sayHello() { | |
| console.log('hello', name); | |
| } | |
| return ( | |
| <button onClick={sayHello}> | |
| Say Hello | |
| </button> | |
| ); |
| .redact { | |
| background-color: #000 !important; | |
| border-radius: 6px !important; | |
| color: transparent !important; | |
| filter: brightness(0) !important; | |
| } |
| const toastProps = { | |
| purpose: 'alert', | |
| variant: 'success', | |
| isClosable: false, | |
| onClose: handleClose, | |
| root: { | |
| 'data-testId': 'root-wrapper', | |
| }, | |
| content: { | |
| id: 'main-toast', |
| const Tab = ({ id, children }) => ( | |
| <Consumer> | |
| {({ changeTab }) => <div onClick={() => changeTab(id)}>{children}</div>} | |
| </Consumer> | |
| ); |