Urgent.News

What's breaking now, across thousands of outlets.

Tech

Day 22 of My Web Development Journey ๐Ÿš€ | Meta Tags and Introduction to React.js

Today, I learned about HTML meta tags and started exploring React.js. I also learned the difference between a library and a framework and how to set up a React project using the terminal. 1. What Are Meta Tags in HTML? Meta tags provide information about a webpage to browsers and search engines. They are placed inside the section of an HTML document. Example <head> <meta charset="UTF-8"> <metaโ€ฆ

On the 22nd day of my web development journey, I delved into the concepts of HTML meta tags and began exploring React.js. I also learned the distinction between a library and a framework and how to set up a React project using the command line interface.

1. What Are Meta Tags in HTML? Meta tags serve as information about a webpage for browsers and search engines. They are embedded within the section of an HTML document. For instance:

```

head

meta charset="UTF-8"

meta name="viewport" content="width=device-width, initial-scale=1.0"

meta name="description" content="My web development learning journey"

title My Website

/head

```

- The `charset` attribute supports a wide range of characters.

- The `name="viewport"` attribute ensures webpages display correctly on different screen sizes.

- The `name="description"` attribute provides a concise description of the webpage.

- The `title` element defines the title shown in the browser tab.

2. Introduction to React.js

React.js is a JavaScript library designed for building user interfaces, particularly interactive web applications.

- React enables developers to partition a webpage into reusable components.

- For example, an e-commerce website might have distinct components for a navbar, product cards, shopping cart, and footer.

- Instead of repeatedly writing the same UI code, components can be reused.

- React.js is a library that aids in constructing user interfaces.

3. What Is a Library?

A library is a collection of pre-written code pieces that assist developers in accomplishing specific tasks.

- React.js, for instance, is a library used for building user interfaces.

- Developers decide when and where to incorporate the library into their application.

4. What Is a Framework?

A framework presents a comprehensive structure for developing an application and frequently dictates how various parts of the application should interact.

- Angular and Next.js are examples of frameworks, although Next.js is specifically a React framework.

- Libraries, in contrast, offer specific functionalities that developers can call upon as needed.

5. Installing React Using the Terminal

To initiate a React project, I commenced by verifying the installation of Node.js and npm via the command line:

```

node -v

npm -v

```

Next, I generated a React project using Vite, specifying the React template:

```

npm create vite@latest my-react-app -- --template react

```

Subsequently, I navigated to the project directory:

```

cd my-react-app

```

I installed the necessary dependencies:

```

npm install

```

Finally, I launched the development server:

```

npm run dev

```

The terminal displayed a local URL that I could access in my browser to view the React application. Throughout this day, I acquired insights into HTML meta tags, the fundamentals of React.js, the differentiation between libraries and frameworks, and the process of establishing a React project using the terminal.

Written by urgent.news from Dev.to's reporting โ€” not their text. Machine-written โ€” may contain errors; check the original before relying on it.

Read the original at dev.to โ†’

More in Tech

Your Custom Hooks Tear in React 18. `useSyncExternalStore` Fixes It.

The header says "You're offline." Three pixels below it, the save button is still clickable, sending requests like nothing's wrong. Same navigator.onLine value. Same render.

  • React 18 introduced useSyncExternalStore to fix tearing issue.
  • useSyncExternalStore allows subscribing to external state without tearing.
  • Include getServerSnapshot for server-side rendering to avoid hydration mismatches.

Replacing Excel with a Next.js Web App: A Dev's Playbook

Every dev has seen it: a business running its entire operation on a 40-tab Excel file named Orders_FINAL_v2_REAL.xlsx. The 'Excel person' holds it all in their head, formulas break silently, andโ€ฆ

  • AimEncoders developed playbook to replace Excel with modern web apps
  • Data modeling foundation for simplified development process
  • PostgreSQL with row-level permissions ensures reliable operation

The .pth file that runs before your code: lessons from the LiteLLM 1.107.0 compromise

The .pth file that runs before your code: lessons from the LiteLLM 1.107.0 compromise Version 1.107.0 of the LiteLLM Python package was published with a credential stealer and a backdoor inside it.

  • .pth file executes Python code before application import, posing security risk
  • LiteLLM 1.107.0 compromise delivered credential stealer and backdoor via compromised GitHub accounts
  • Malicious .pth file triggered credential collector at interpreter start-up

PSL 12 Player Auction Date Announced

The Pakistan Super League (PSL 12) has scheduled the player auction for its 12th edition for January 23, 2027, as โ€ฆ Read More The post PSL 12 Player Auction Date Announced appeared first onโ€ฆ

More from Friday 23 October โ†’