Telegram Group & Telegram Channel
React 19 Beta

Eng katta yangiliklar:

1. Server actions
2. use huki

Shaxsan menga eng yoqqan o'zgarishlar:

1. Funksiyaviy komponentlar uchun endi forwardRef shart emas. Shunchaki props.ref qilib ishlatsa bo'ladi.

function Comp({ ref }) {
return <input ref={ref} />
}


2. <Context /> o'zini endi Provider qilib ishlash mumkin. Ya'ni <Context.Provider /> qilib o'tirmasadan. 💚

const Context = createContext('');

function App({children}) {
return (
<Context>
{children}
</Context>
);
}



3. Meta teglarni endi bemalol ishlatsa bo'ladi. Xatto CSS fayllarni qo'shish mumkin: 😍

function Page() {
return (
<div>
<title>Sarlavha</title>
<link
rel="stylesheet"
href="/page.css"
precedence="default"
/>
<meta name="author" content="Diyor" />
</div>
)
}


4. useFormStatus
Endi <form> huddi Context kabi ishlaydi va uning ichida joylashgan komponentlar useFormStatus orqali formaning holatini o'qishlari mumkin (pending, submitted, ...).
Oldin bu ish uchun alohida Context yoki proplar zanjiri kerak bo'lardi.

Batafsil: https://react.dev/blog/2024/04/25/react-19#improvements-in-react-19
🔥14👍8



tg-me.com/brogrammist/180
Create:
Last Update:

React 19 Beta

Eng katta yangiliklar:

1. Server actions
2. use huki

Shaxsan menga eng yoqqan o'zgarishlar:

1. Funksiyaviy komponentlar uchun endi forwardRef shart emas. Shunchaki props.ref qilib ishlatsa bo'ladi.


function Comp({ ref }) {
return <input ref={ref} />
}


2. <Context /> o'zini endi Provider qilib ishlash mumkin. Ya'ni <Context.Provider /> qilib o'tirmasadan. 💚

const Context = createContext('');

function App({children}) {
return (
<Context>
{children}
</Context>
);
}



3. Meta teglarni endi bemalol ishlatsa bo'ladi. Xatto CSS fayllarni qo'shish mumkin: 😍

function Page() {
return (
<div>
<title>Sarlavha</title>
<link
rel="stylesheet"
href="/page.css"
precedence="default"
/>
<meta name="author" content="Diyor" />
</div>
)
}


4. useFormStatus
Endi <form> huddi Context kabi ishlaydi va uning ichida joylashgan komponentlar useFormStatus orqali formaning holatini o'qishlari mumkin (pending, submitted, ...).
Oldin bu ish uchun alohida Context yoki proplar zanjiri kerak bo'lardi.

Batafsil: https://react.dev/blog/2024/04/25/react-19#improvements-in-react-19

BY Brogrammist




Share with your friend now:
tg-me.com/brogrammist/180

View MORE
Open in Telegram


Brogrammist Telegram | DID YOU KNOW?

Date: |

China’s stock markets are some of the largest in the world, with total market capitalization reaching RMB 79 trillion (US$12.2 trillion) in 2020. China’s stock markets are seen as a crucial tool for driving economic growth, in particular for financing the country’s rapidly growing high-tech sectors.Although traditionally closed off to overseas investors, China’s financial markets have gradually been loosening restrictions over the past couple of decades. At the same time, reforms have sought to make it easier for Chinese companies to list on onshore stock exchanges, and new programs have been launched in attempts to lure some of China’s most coveted overseas-listed companies back to the country.

Brogrammist from hk


Telegram Brogrammist
FROM USA