Skip Navigation
Programmers then and now
  • If you define what you mean by centering I'll give you a straight answer.

    Vertically? Horizontally? Center the text or the entire box? Compared to the viewport, the parent container or the entire page?

    "Centering" isn't as straight forward as you'd think, and what you actually want usually depends on the situation.

  • Component loaders for React + React/RTK Query
    rtk-query-loader.ryfylke.dev Introduction | RTK Query Loader

    Create loaders for your React components.

    Introduction | RTK Query Loader

    RTK Query Loader lets you create loaders for your React components.

    ```typescript const loader = createLoader({ useQueries: () => { const [name, setName] = useState("charizard"); const debouncedName = useDebounce(name, 200); const pokemon = useGetPokemon(debouncedName); return { queries: { pokemon, }, payload: { name, setName, }, }; }, });

    const Consumer = withLoader((props, data) => { return ( <div> <input value={data.payload.name} onChange={(e) => data.payload.setName(e.target.value)} /> <div>AP: {data.queries.pokemon.data.ability_power}</div> </div> ); }, loader); ```

    0
    InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)IM
    impedans @lemmy.world
    Posts 1
    Comments 2