The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Lazy initializer for useState

TODO: Pull subtitle into page object code_start_default_section code_end_default_section

If you pass a function as the argument to useState() it'll use that for the initial load and only call that when necessary instead of on each render

TODO: Confirm that code snippet

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Lazy initializer for useState

-- code/
-- jsx

const [thing, setThing] = useState(() => { some_expensive_operation ? 'yes' : 'no' })

-- /code

-- p

If you pass a function as the argument to useState() it'll use that for the initial load and only call that when necessary instead of on each render

-- p

TODO: Confirm that code snippet


-- categories
-- Miscellaneous

-- metadata
-- date: 2022-03-19 19:45:09
-- id: 26cr2esj
-- status: draft
-- type: post
-- SCRUBBED_NEO: false
-- site: aws