The src/components folder holds reusable UI parts like buttons and headers. The public folder is for static files, node_modules stores installed packages, and src/assets holds images or styles.
public folder and reference it in your React app?Files in the public folder are served directly as static assets. They are not processed by React but can be accessed via URL paths.
src/
components/
Button.jsx
App.jsxWhich import statement correctly imports
Button into App.jsx?Since App.jsx and components are both inside src, the correct relative path is ./components/Button.
styles.css inside src/assets but imports it in App.jsx as:import '../assets/styles.css';
Why does this cause an error?
Since App.jsx is inside src, using ../assets tries to go outside src, which is invalid. The correct path is ./assets/styles.css.
src/components to src/hooks. What is the main benefit of this change?Moving custom hooks to a dedicated src/hooks folder helps keep UI components focused on display, while hooks handle state logic. This separation makes the code cleaner and easier to maintain.
