Telegram Group & Telegram Channel
Управление типами кортежей

Предположим, у нас есть функция, которая возвращает кортеж, например, пользовательский хук:


function useBool(initialValue = false) {
const [state, setState] = React.useState(initialValue)

const handlers = React.useMemo(
() => ({
on: () => setState(true),
off: () => setState(false),
toggle: () => setState(s => !s),
reset: () => setState(initialValue),
}),
[initialValue],
)

return [state, handlers]
}

const result = useBool()



https://kyleshevlin.com/wrangling-tuple-types/

✍️ @React_lib



tg-me.com/React_lib/605
Create:
Last Update:

Управление типами кортежей

Предположим, у нас есть функция, которая возвращает кортеж, например, пользовательский хук:


function useBool(initialValue = false) {
const [state, setState] = React.useState(initialValue)

const handlers = React.useMemo(
() => ({
on: () => setState(true),
off: () => setState(false),
toggle: () => setState(s => !s),
reset: () => setState(initialValue),
}),
[initialValue],
)

return [state, handlers]
}

const result = useBool()



https://kyleshevlin.com/wrangling-tuple-types/

✍️ @React_lib

BY React


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/React_lib/605

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

Traders also expressed uncertainty about the situation with China Evergrande, as the indebted property company has not provided clarification about a key interest payment.In economic news, the Commerce Department reported an unexpected increase in U.S. new home sales in August.Crude oil prices climbed Friday and front-month WTI oil futures contracts saw gains for a fifth straight week amid tighter supplies. West Texas Intermediate Crude oil futures for November rose $0.68 or 0.9 percent at 73.98 a barrel. WTI Crude futures gained 2.8 percent for the week.

Telegram is riding high, adding tens of million of users this year. Now the bill is coming due.Telegram is one of the few significant social-media challengers to Facebook Inc., FB -1.90% on a trajectory toward one billion users active each month by the end of 2022, up from roughly 550 million today.

telegram from ms


Telegram React
FROM USA