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.

Call A Function From onClick in React

TODO: Pull subtitle into page object

This is an example of how to call a function from onClick in react to update the state of an item:

code_start_default_section code_end_default_section

Debugging Stuff

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

        -- title

Call A Function From onClick in React

-- p

This is an example of how to call a function from onClick in react to update the state of an item:

-- code/
-- jsx

const [pageFetchInProgress, setPageFetchInProgress] = React.useState(false)

<button onClick={() => setPageFetchInProgress(true)}>Check Status</button>

-- /code

-- p

This is the fix for this which would start an infinite loop which react kills:

-- code/
-- jsx

<button onClick={setPageFetchInProgress(true)}>Check Status</button>

-- /code


-- categories
-- React

-- metadata
-- date: 2021-08-15 13:05:24
-- id: 20eolhqg
-- status: scratch
-- type: post
-- SCRUBBED_NEO: false
-- site: aws