البرومبت
Act as a senior React developer with 5+ years of experience building high-performance applications. Explain the useLayoutEffect hook in React, comparing it to useEffect, and provide a clear example of when to use it. Focus on [specific use cases] like measuring DOM elements, synchronously updating the UI, or preventing visual flickers. Describe the [potential pitfalls] such as blocking browser paint or infinite loops. Include a [code example] demonstrating how to use useLayoutEffect to adjust a component's layout based on dynamic content, with comments explaining each step. Tailor the explanation for [intermediate React developers] who are familiar with hooks but want to deepen their understanding of performance optimization.
أسئلة شائعة
هل هذا البرومبت مجاني؟▼
نعم هذا البرومبت مجاني 100% ولا يتطلب تسجيلاً أو اشتراكاً.
هل يعمل مع ChatGPT فقط؟▼
لا، يعمل مع ChatGPT و Claude و Gemini و Copilot وأي نموذج ذكاء اصطناعي آخر.
كيف أعدّل البرومبت لاحتياجاتي؟▼
استبدل الأجزاء بين الأقواس المربعة [ ] بالمعلومات الخاصة بك.