Hello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello World
hi-devs
Discover
Fresh questions, posts, and roles from the community—newest first.
Recent questions
Value prop updates but UI stays the same. ``` function Child({ value }) { const [localValue, setLocalValue] = useState(value); } ```
``` useEffect(async () => { const data = await fetchData(); setData(data); }, []); ```
Latest posts
Node.js is widely used for creating APIs. Let’s build a minimal Express server. ``` const express = require("express"); const app = express(); app.get("/api/hello", (req, res) => { res.json({ message: "Hello from Node.js API" }); }); app.listen(3000, () => { console.log("Server running on port 3000"); }); ``` What this code does: - Creates an Express app - Defines a GET route - Sends a JSON response
HI Shanto
3 months ago
One of Next.js’s best features is file-based routing. You don’t need to configure routes manually. Create a file called page.js inside the app directory: ``` export default function HomePage() { return ( <main> <h1>Welcome to Next.js</h1> <p>This page was created using file-based routing.</p> </main> ); } ``` Benefits: - [x] No routing configuration - [x] Cleaner project structure - [x] Faster development
HI Shanto
3 months ago
State is one of the core concepts in React. Without state, components would be static and unable to respond to user interactions. Let’s start with a simple counter example using the `useState` hook. ``` import { useState } from "react"; function Counter() { const [count, setCount] = useState(0); return ( <div> <p>Count: {count}</p> <button onClick={() => setCount(count + 1)}> Increment </button> </div> ); } export default Counter; ``` Here’s what’s happening: - [x] useState(0) initializes the state with a value of 0 - [x] count holds the current state - [x] setCount updates the state and triggers a re-render
HI Shanto
3 months ago
Latest jobs
WebWorks