Skip to main content

Posts

Showing posts from May, 2024

BSMS complexities and issue i face and their solutions

Issue1 I import css file in next js component but i can't see it in head tag in browser by inspecting page. When you import css fie in ou component it not automatically add them in your "head" tag. Usually, it optimizes CSS delivery by automatically code-splitting and lazy-loading stylesheets. This means that stylesheets are loaded when they're needed, improving performance. I have implemented this practically in BSMS System. Example // components/Layout.js import Head from 'next/head' ; import "../../public/styles/globalStyles.css" ; const Layout = ( { children } ) => { return ( < div className = "layout" > < Head > {/* Global styles */} < link rel = "stylesheet" href = "/styles/globalStyles.css" /> </ Head > {children} </ div > ); }; export default Layout ; // pages/Home.js import Head from 'next/head' ; con...

Hooks in react

  useRef: This hook is use to manipulate DOM directly. This is use to persist value between rendering of the component. It can contain mutable value that can not cause re-render when their values update. Example: It is use to focus, change color, get previous states. for further details visit this link https://www.w3schools.com/REACT/react_useref.asp