There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.
Consider adopting the new property pattern, wherever you use IsNullOrEmpty.
string? hello = "hello world";| import React, { memo, useCallback } from 'react'; | |
| import ChildComponent from './wherever/ChildComponent.js'; | |
| const updateChild = (props, childId, changes) => { | |
| props.onUpdate({ | |
| type: 'childChanged', | |
| childId: childId, | |
| changes: changes, | |
| }); | |
| }; |
| // This file was initially generated by Windows Terminal 0.11.1191.0 | |
| // It should still be usable in newer versions, but newer versions might have additional | |
| // settings, help text, or changes that you will not see unless you clear this file | |
| // and let us generate a new one for you. | |
| // To view the default settings, hold "alt" while clicking on the "Settings" button. | |
| // For documentation on these settings, see: https://aka.ms/terminal-documentation | |
| { | |
| "$schema": "https://aka.ms/terminal-profiles-schema", |
There are lots of cases that you can improve. The examples use nullable reference types, but only the WhenNotNull example requires it.
Consider adopting the new property pattern, wherever you use IsNullOrEmpty.
string? hello = "hello world";Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.
You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.
You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)
Don't like Next? Here's how to do the same in Gatsby.
| /** | |
| /DOBPicker.tsx | |
| **/ | |
| 'use client'; | |
| import * as React from 'react'; | |
| import { format, subYears } from 'date-fns'; | |
| import { cn } from '@/lib/utils'; | |
| import { Button } from '@/components/ui/button'; |
See the new site: https://postgresisenough.dev
| import path from 'path'; | |
| import { fileURLToPath } from 'url'; | |
| import comments from '@eslint-community/eslint-plugin-eslint-comments/configs'; | |
| import { FlatCompat } from '@eslint/eslintrc'; | |
| import js from '@eslint/js'; | |
| import nextPlugin from '@next/eslint-plugin-next'; | |
| import eslintConfigPrettier from 'eslint-config-prettier'; | |
| import hooksPlugin from 'eslint-plugin-react-hooks'; | |
| import reactRecommended from 'eslint-plugin-react/configs/recommended.js'; |