🚀 Top 10 React Basic Interview Questions 🔹 1. What is useState? - > used to manage state in functional components const [count, setCount] = useState(0); 🔹 2. What is useEffect? -> handles side effects (API calls, subscriptions) useEffect(() => { console.log("Component Mounted"); }, []); 🔹 3. How to handle forms in React? (Controlled Components) const [input, setInput] = useState(""); <input value={input} onChange={e => setInput(e.target.value)} /> 🔹 4. How to fetch API data? useEffect(() => { fetch("/api") .then(res => res.json()) .then(data => console.log(data)); }, []); 🔹 5. What is conditional rendering? {isLoggedIn ? <Dashboard /> : <Login />} 🔹 6. How to pass data from parent to child? <Child name="Test" /> 🔹 7. How to optimize performance? (React.memo) export default React.memo(Component); 🔹 8. What is useCallback? -> memoizes functions const handleClick = useCallback(() => {}, []); 🔹 9. What is useMemo? -> memoizes values const value = useMemo(() => compute(), []); 🔹 10. How to handle list rendering? items.map(item => <li key={item.id}>{item.name}</li>); ✅ If you are preparing for ReactJs interview, save this for your next interview! 👉 Follow Tarun Kumar for tech content, coding tips, and interview prep 🚀 #ReactJS #FrontendDeveloper #JavaScript #WebDevelopment #CodingInterview #SoftwareEngineer #TechCareers #LearnReact
Keep sharing
Great list! One thing interviewers love to follow up on useEffect — What's the difference between these 3? ```js useEffect(() => {}) // runs on every render useEffect(() => {}, []) // runs only on mount useEffect(() => {}, [id]) // runs when id changes ```Got asked this in my interview and it's where most people slip up. The dependency array is everything.