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: |

The S&P 500 slumped 1.8% on Monday and Tuesday, thanks to China Evergrande, the Chinese property company that looks like it is ready to default on its more-than $300 billion in debt. Cries of the next Lehman Brothers—or maybe the next Silverado?—echoed through the canyons of Wall Street as investors prepared for the worst.

Start with a fresh view of investing strategy. The combination of risks and fads this quarter looks to be topping. That means the future is ready to move in.Likely, there will not be a wholesale shift. Company actions will aim to benefit from economic growth, inflationary pressures and a return of market-determined interest rates. In turn, all of that should drive the stock market and investment returns higher.

Brogrammist from in


Telegram Brogrammist
FROM USA