We want to hear from you!Take our 2020 Community Survey!

CDN Havolalar

React va ReactDOM ikkalasi ham CDN orqali mavjud.

<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>

Yuqoridagi versiyalar faqat dasturlash uchun mo’ljallangan va foydalanuv uchun mos emas. React-ning minimallashtirilgan va optimallashtirilgan foydalanuv versiyalari quyidagi CDN lar orqali mavjud:

<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>

React va React-dom ning ma’lum bir versiyasini yuklash uchun 17 raqamini versiya raqami bilan almashtiring.

Nima uchun crossorigin Atributi?

Agar siz React ni CDN orqali ishlatmoqchi bo’lsangiz, crossorigin atributini qo’shishni tavsiya etamiz:

<script crossorigin src="..."></script>

Siz foydalanayotgan CDN-ning Access-Control-Allow-Origin: * HTTP headerini o’rnatganligini tekshirishni tavsiya etamiz.

Access-Control-Allow-Origin: *

Bu React 16 va undan keyingi versiyalarida xatolarni boshqarish tajribasi ni yaxshilaydi.

Is this page useful?Edit this page