Category: React

  • Handling Events

    Handling events in React is straightforward and similar to handling events in plain JavaScript. However, there are some key differences and benefits that come with React’s event system.

    React Event Handling

    Adding Event Handlers in JSX

    In React, you add event handlers directly in the JSX by using camelCase syntax for event names and passing a function as the event handler.

    Example:

    function ActionButton() {
      function handleClick() {
        alert('Button clicked!');
      }
    
      return <button onClick={handleClick}>Click Me</button>;
    }
    
    ReactDOM.render(<ActionButton />, document.getElementById('root'));

    In this example, the handleClick function is called when the button is clicked.

    Synthetic Events in React

    React normalizes events so that they have consistent properties across different browsers. This is achieved through a system called synthetic events. Synthetic events are wrappers around the native browser events and work identically across all browsers.

    Example:

    function MouseTracker() {
      function handleMouseOver(event) {
        console.log('Mouse over:', event.clientX, event.clientY);
      }
    
      return <div onMouseOver={handleMouseOver}>Hover over me!</div>;
    }
    
    ReactDOM.render(<MouseTracker />, document.getElementById('root'));

    In this example, handleMouseOver logs the mouse coordinates whenever the mouse is moved over the div.

    Passing Arguments to Event Handlers

    Sometimes, you need to pass additional arguments to your event handlers. You can achieve this by using an arrow function or the bind method.

    Using Arrow Functions:

    Example:

    function ActionButton() {
      function handleClick(message) {
        alert(message);
      }
    
      return (
        <button onClick={() => handleClick('Button clicked!')}>
          Click Me
        </button>
      );
    }
    
    ReactDOM.render(<ActionButton />, document.getElementById('root'));

    In this example, an arrow function is used to call handleClick with the message argument.

    Using bind Method:

    Example:

    function ActionButton() {
      function handleClick(message, event) {
        alert(message);
        console.log('Event:', event);
      }
    
      return (
        <button onClick={handleClick.bind(this, 'Button clicked!')}>
          Click Me
        </button>
      );
    }
    
    ReactDOM.render(<ActionButton />, document.getElementById('root'));

    In this example, the bind method is used to pass the message argument to handleClick. The event object is automatically passed as the second argument.

    Conclusion

    Handling events in React is a crucial aspect of creating interactive and dynamic applications. By understanding how to add event handlers in JSX, leverage synthetic events for cross-browser consistency, and pass arguments to event handlers, you can enhance the functionality of your React components. These skills form the foundation for building more complex user interactions in your React applications.

    Next, we’ll explore how to handle forms in React, including controlled components, form submissions, and accessing DOM elements using refs.

  • Rendering Elements

    Rendering elements is one of the core aspects of React, as it allows you to display dynamic content in your application. In this section, we’ll cover the basics of rendering a React component, updating rendered elements, and implementing conditional rendering.

    React Rendering

    Rendering a React Component

    To render a React component, you use the ReactDOM.render method. This method takes two arguments: the component to render and the DOM element where the component should be mounted.

    Here’s an example of rendering a simple Greeting component:

    Greeting Component:

    // Greeting.js
    import React from 'react';
    
    function Greeting(props) {
      return <h1>Hello, {props.name}!</h1>;
    }
    
    export default Greeting;

    Rendering the Component:

    // index.js
    import React from 'react';
    import ReactDOM from 'react-dom';
    import Greeting from './Greeting';
    
    ReactDOM.render(<Greeting name="Niraj" />, document.getElementById('root'));

    In this example, the Greeting component is rendered into the DOM element with the ID root.

    Updating the Rendered Element

    React efficiently updates the rendered elements using a virtual DOM. When the state or props of a component change, React updates only the parts of the DOM that have changed.

    Here’s an example demonstrating how updating the state updates the rendered element:

    Counter Component:

    // Counter.js
    import React, { 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;

    Rendering the Component:

    // index.js
    import React from 'react';
    import ReactDOM from 'react-dom';
    import Counter from './Counter';
    
    ReactDOM.render(<Counter />, document.getElementById('root'));

    In this example, clicking the “Increment” button updates the count state, and React re-renders the Counter component with the new count value.

    Conditional Rendering in React

    Conditional rendering allows you to render different components or elements based on certain conditions. This can be achieved using JavaScript conditional operators within JSX.

    Using if-else for Conditional Rendering:

    You can use JavaScript if-else statements to conditionally render elements.

    Example:

    function UserGreeting(props) {
      return <h1>Welcome back!</h1>;
    }
    
    function GuestGreeting(props) {
      return <h1>Please sign up.</h1>;
    }
    
    function Greeting(props) {
      const isLoggedIn = props.isLoggedIn;
      if (isLoggedIn) {
        return <UserGreeting />;
      }
      return <GuestGreeting />;
    }
    
    ReactDOM.render(<Greeting isLoggedIn={true} />, document.getElementById('root'));

    Using Ternary Operator for Conditional Rendering:

    The ternary operator is a more concise way to conditionally render elements.

    Example:

    function Greeting(props) {
      const isLoggedIn = props.isLoggedIn;
      return (
        <div>
          {isLoggedIn ? <h1>Welcome back!</h1> : <h1>Please sign up.</h1>}
        </div>
      );
    }
    
    ReactDOM.render(<Greeting isLoggedIn={false} />, document.getElementById('root'));

    Using Logical && Operator for Conditional Rendering:

    The logical && operator can be used to conditionally include an element.

    Example:

    function Mailbox(props) {
      const unreadMessages = props.unreadMessages;
      return (
        <div>
          <h1>Hello!</h1>
          {unreadMessages.length > 0 && (
            <h2>You have {unreadMessages.length} unread messages.</h2>
          )}
        </div>
      );
    }
    
    const messages = ['React', 'Re: React', 'Re:Re: React'];
    ReactDOM.render(
      <Mailbox unreadMessages={messages} />,
      document.getElementById('root')
    );

    In this example, the message count is displayed only if there are unread messages.

    Conclusion

    Rendering elements is a fundamental concept in React that enables you to create dynamic and interactive UIs. By understanding how to render components, update rendered elements, and implement conditional rendering, you can build more complex and responsive applications. React’s ability to efficiently update and render only the necessary parts of the DOM makes it a powerful tool for building modern web applications. Next, we’ll delve into more advanced concepts such as handling events and forms in React.

  • Components in React

    Components are the fundamental building blocks of a React application. They allow you to break down the UI into reusable and isolated pieces. There are two main types of components in React: function components and class components.

    React Components

    Function and Class Components

    • Function ComponentsFunction components are the simpler of the two types. They are JavaScript functions that return JSX. Function components do not have their own state or lifecycle methods (prior to the introduction of hooks).Here’s an example of a simple function component:
    function Greeting(props) {
      return <h1>Hello, {props.name}!</h1>;
    }
    • Class ComponentsClass components are more feature-rich than function components. They are ES6 classes that extend React.Component and must define a render method that returns JSX.Here’s an example of a class component:
    class Greeting extends React.Component {
      render() {
        return <h1>Hello, {this.props.name}!</h1>;
      }
    }

    Creating and Using Components

    • Creating ComponentsTo create a component, simply define a function or a class that returns JSX. Each component should be placed in its own file, making it easier to manage and reuse.For example, let’s create a Greeting component:
    • Function Component:
    // Greeting.js
    import React from 'react';
    
    function Greeting(props) {
      return <h1>Hello, {props.name}!</h1>;
    }
    
    export default Greeting;
    • Class Component:
    // Greeting.js
    import React from 'react';
    
    class Greeting extends React.Component {
      render() {
        return <h1>Hello, {this.props.name}!</h1>;
      }
    }
    
    export default Greeting;
    • Using ComponentsTo use a component, import it into another file and include it in the JSX of that file.For example, using the Greeting component in an App component:
    // App.js
    import React from 'react';
    import Greeting from './Greeting';
    
    function App() {
      return (
        <div>
          <Greeting name="Sujal" />
          <Greeting name="Sahu" />
        </div>
      );
    }
    
    export default App;

    Component Props and Default Props

    • Component PropsProps (short for properties) are a way to pass data from parent components to child components. They are read-only and cannot be modified by the child component.For example, in the Greeting component above, props.name is used to display the name passed from the parent component.
    • Default PropsDefault props allow you to set default values for props if they are not provided by the parent component.Here’s how you can define default props for a function component:
    Greeting.defaultProps = {
      name: 'Guest'
    };

    And for a class component:

    class Greeting extends React.Component {
      static defaultProps = {
        name: 'Guest'
      };
    
      render() {
        return <h1>Hello, {this.props.name}!</h1>;
      }
    }

    Component State and setState Method

    • Component StateState is a way to manage data that can change over time within a component. State is private to the component and can be modified using the setState method.Here’s an example of a class component with state:
    class Counter extends React.Component {
      constructor(props) {
        super(props);
        this.state = { count: 0 };
      }
    
      render() {
        return (
          <div>
            <p>Count: {this.state.count}</p>
            <button onClick={() => this.setState({ count: this.state.count + 1 })}>
              Increment
            </button>
          </div>
        );
      }
    }
    
    export default Counter;
    • setState MethodThe setState method is used to update the component’s state. It schedules an update to the component’s state object and tells React to re-render the component with the updated state.For example, in the Counter component above, clicking the button updates the count state and re-renders the component with the new count value.With the introduction of hooks, function components can also manage state using the useState hook:
    import React, { 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;

    Conclusion

    Components are the backbone of any React application. By understanding how to create and use function and class components, manage props and state, and leverage the setState method, you can build powerful and dynamic user interfaces. As you continue to develop your React skills, you’ll find that components provide a flexible and reusable way to construct your application’s UI.

  • Understanding JSX

    JSX is a syntax extension for JavaScript that combines the expressiveness of JavaScript with the familiarity of HTML. It is a core concept in React and makes it easier to create and visualize the structure of your user interfaces.

    What is JSX?

    what is JSX

    JSX stands for JavaScript XML. It allows you to write HTML-like syntax directly within JavaScript, making your code more readable and declarative. While it looks similar to HTML, JSX has the full power of JavaScript, enabling you to embed expressions and manipulate the DOM efficiently.

    Writing JSX Syntax

    • JSX syntax is straightforward but has some differences from HTML:
      • You can use JavaScript expressions within JSX by wrapping them in curly braces {}.
      • JSX tags must be properly closed, either with a closing tag (</>), or self-closing for elements with no children (< />).
      Here’s an example of JSX syntax:
    const element = <h1>Hello, world!</h1>;

    This is how you would render this element using React:

    import React from 'react';
    import ReactDOM from 'react-dom';
    
    const element = <h1>Hello, world!</h1>;
    
    ReactDOM.render(element, document.getElementById('root'));

    Embedding Expressions in JSX

    One of the powerful features of JSX is the ability to embed JavaScript expressions directly within your markup. This is done by wrapping the expressions in curly braces {}.

    For example:

    const name = 'Niraj';
    const element = <h1>Hello, {name}!</h1>;

    This will render as:

    <h1>Hello, Niraj!</h1>

    You can also embed more complex expressions:

    const user = {
      firstName: 'Niraj',
      lastName: 'Kumar'
    };
    
    const element = <h1>Hello, {user.firstName} {user.lastName}!</h1>;

    This allows you to dynamically render content based on your application’s state or props.

    JSX Attributes and Children

    JSX supports attributes similar to HTML. These attributes can be used to pass data to components, just like props in React.

    For example:

    const element = <img decoding="async" src="logo.png" alt="Logo" />;

    Notice the use of camelCase for attributes, like className instead of class and onClick instead of onclick.

    Children in JSX

    JSX allows you to nest elements inside other elements, enabling you to build complex structures.

    For example:

    const element = (
      <div>
        <h1>Hello, world!</h1>
        <p>Welcome to learning React.</p>
      </div>
    );

    This nests a <h1> and a <p> element inside a <div>, creating a parent-child relationship.

    JSX can also contain JavaScript expressions as children:

    const items = ['Apple', 'Banana', 'Cherry'];
    const element = (
      <ul>
        {items.map((item) => (
          <li key={item}>{item}</li>
        ))}
      </ul>
    );

    Here, the map function iterates over an array of items and returns a list of <li> elements. Each list item is assigned a unique key attribute, which is crucial for performance and managing dynamic lists in React.

    Conclusion

    JSX is a powerful and flexible syntax that blends HTML-like structure with JavaScript’s capabilities. It makes writing and understanding React components easier and more intuitive. By leveraging JSX, you can create dynamic, interactive UIs efficiently and effectively. As you continue to explore React, you’ll see how JSX plays a central role in building and managing your application’s user interface.

    Next, we’ll dive into components, the building blocks of any React application, and learn how to create and use them effectively.

  • Setting Up the Development Environment

    Before building a React application, you need to set up the development environment. This includes installing Node.js and npm, setting up a new React project using create-react-app, and exploring the project structure.

    Installing Node.js and npm

    eact relies on Node.js and its package manager, npm (Node Package Manager), to install libraries and manage dependencies. Node.js allows you to run JavaScript code outside of the browser, and npm helps you manage the packages required by your React project.

    1.1 Download and Install Node.js

    To install Node.js and npm, follow these steps:

    1. Visit the Node.js website: Node.js Download.
    2. Download the LTS (Long-Term Support) version, which includes npm.
    3. Follow the installation instructions for your operating system (Windows, macOS, or Linux).
    1.2 Verify Installation

    Once Node.js and npm are installed, you can verify the installation by running the following commands in your terminal or command prompt:

    node -v
    npm -v

    You should see the installed version of Node.js and npm printed to the console. If both versions are displayed, Node.js and npm are successfully installed.

    Using Create React App to Set Up a New React Project

    create-react-app is a command-line tool that helps you quickly set up a new React project with a well-structured development environment, including all necessary configurations and dependencies. It simplifies the setup process by automating the configuration of webpack, Babel, and other tools, so you can focus on writing your React code.

    2.1 Installing create-react-app

    You can globally install the create-react-app tool using npm by running the following command:

    bash

    npm install -g create-react-app

    Alternatively, you can use npx (which comes with npm 5.2+), so you don’t need to install it globally:

    npx create-react-app my-app

    This will create a new folder named my-app containing all the necessary files and dependencies for a new React project.

    2.2 Creating a New React Project

    After installing or using npx, you can create a new React project by running:

    npx create-react-app my-app

    Replace my-app with the name of your project. This will take a few moments as it sets up the development environment.

    2.3 Starting the Development Server

    Once the project is set up, navigate into your project folder and start the development server:

    cd my-app
    npm start

    This will start a local development server and open the app in your default web browser at http://localhost:3000. The development server supports live reloading, meaning any changes you make in the code will automatically be reflected in the browser without refreshing.

    Exploring the Project Structure

    When you create a React project using create-react-app, it automatically sets up a basic project structure with several important files and folders.

    Here’s an overview of the key files and directories created:

    my-app/
    ├── node_modules/
    ├── public/
    ├── src/
    ├── .gitignore
    ├── package.json
    ├── package-lock.json
    └── README.md
    3.1 Key Folders
    • node_modules/: This directory contains all the third-party packages and dependencies installed by npm. You don’t need to modify anything here directly.
    • public/: This folder contains static assets for your application, including the main HTML file (index.html), images, and other public resources. The contents of this folder are not processed by Webpack and are directly accessible at the root of your web app.
      • index.html: The main HTML file for the application. The React application is injected into the <div id="root"></div> element in this file.
      • favicon.ico: The favicon displayed in the browser tab.
    • src/: This is where the main source code for your React application resides. You will write most of your code inside this folder.Key files in the src/ directory include:
      • index.js: The entry point for the React app. This file renders the root React component (<App />) into the DOM.
    import React from 'react';
    import ReactDOM from 'react-dom';
    import './index.css';
    import App from './App';
    
    ReactDOM.render(<App />, document.getElementById('root'));
    • App.js: This is the main React component where you will start building your UI. Initially, it displays a basic welcome page. You can modify this component or break it into smaller components as the app grows.
    function App() {
      return (
        <div className="App">
          <header className="App-header">
            <h1>Welcome to React</h1>
          </header>
        </div>
      );
    }
    
    export default App;
    • App.css: The default stylesheet for the App.js component. You can modify or remove this file depending on your styling preferences.
    3.2 Configuration Files
    • .gitignore: This file specifies which files and folders should be ignored by Git. For example, node_modules/ and build artifacts are typically excluded from version control.

    package.json: This file contains metadata about your project, including its name, version, dependencies, and scripts. It’s essential for managing packages and running various npm commands.

    Example:

    {
      "name": "my-app",
      "version": "0.1.0",
      "private": true,
      "dependencies": {
        "react": "^17.0.2",
        "react-dom": "^17.0.2",
        "react-scripts": "4.0.3"
      },
      "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts build",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
      }
    }
    • README.md: A markdown file with instructions for the project. This file can be customized to include details about your project, how to run it, and any important notes for developers or users.

    Conclusion

    Setting up the development environment for a React project is straightforward with the help of Node.jsnpm, and create-react-app. Once your environment is set up, you can start the React development server and explore the well-structured project files. From here, you can modify the existing components, add new ones, and start building a dynamic and interactive user interface.

  • What is React?

    React Definition

    React is a JavaScript library developed by Facebook for building user interfaces, particularly for single-page applications (SPAs) where the user interacts with a webpage without needing to reload it. React helps in efficiently managing the user interface (UI) by allowing developers to build web pages in a modular fashion using reusable components.

    Unlike traditional JavaScript libraries or frameworks, React focuses solely on the view layer of an application (the “V” in MVC — Model-View-Controller). It enables developers to build fast and scalable user interfaces by breaking down the UI into independent, reusable pieces of code known as components. React components can manage their own state, and React updates the UI efficiently when that state changes.

    History and Origin

    React was first created by Jordan Walke, a software engineer at Facebook, in 2011. Initially, it was used internally at Facebook to address the growing complexity of their web applications. One of the key motivations behind React was the inefficiency of updating the Document Object Model (DOM) manually, especially in large and dynamic web applications.

    In 2013, React was released as an open-source library, and it quickly gained popularity due to its simplicity, performance, and ability to handle dynamic data efficiently. It was initially criticized for using JSX (a syntax extension that mixes JavaScript and HTML), but JSX has since been embraced by the developer community for its readability and powerful capabilities.

    Advantages of Using React:

    React offers several advantages that have made it one of the most widely used JavaScript libraries for building user interfaces.

    1. Component-Based Architecture

    React allows developers to break down a complex UI into independent, reusable components. Each component in React is responsible for rendering a small, isolated piece of the UI. This modular approach makes development more manageable, promotes reusability, and improves maintenance.

    2. Virtual DOM for Efficient Rendering

    One of the core innovations of React is the Virtual DOM. Instead of directly manipulating the real DOM, React creates a virtual representation of it. When a component’s state or data changes, React updates the Virtual DOM first and then compares it with the real DOM. It calculates the minimal set of changes needed and updates only the parts of the real DOM that have changed, resulting in faster and more efficient rendering.

    3. Declarative UI

    React’s declarative approach to building user interfaces simplifies the process of describing what the UI should look like. Instead of writing imperative code to describe how the UI should update based on changes, you simply declare the UI components, and React handles updating them based on the current state.

    4. JSX (JavaScript XML)

    React uses JSX, a syntax extension that allows developers to write HTML-like code inside JavaScript. JSX is easy to understand and helps visualize the structure of the UI. It compiles down to JavaScript, making it a powerful and flexible tool for building user interfaces.

    const element = <h1>Hello, World!</h1>;
    5. Unidirectional Data Flow

    React uses a unidirectional data flow, meaning that data flows from parent components to child components. This makes data management easier to reason about, as each component receives data as props and renders it without directly modifying the parent’s state.

    6. State Management

    React components can manage their own state. The state is an object that holds dynamic data and determines how the component renders and behaves. When the state changes, React automatically re-renders the component, updating the UI in a seamless and efficient manner.

    7. Ecosystem and Tooling

    The React ecosystem is vast, with a rich set of tools, libraries, and extensions. Some of the key tools include:

    • React Developer Tools for debugging.
    • React Router for handling routing in SPAs.
    • Redux for advanced state management.
    • Next.js for server-side rendering and static site generation.
    8. Cross-Platform Development

    React allows developers to build not only web applications but also native mobile applications using React Native. With React Native, developers can write mobile apps for iOS and Android using the same React syntax, leveraging their existing skills for cross-platform development.

    9. Strong Community and Support

    React has a large and active community, which means that developers have access to extensive documentation, tutorials, and support from the community. Facebook, along with other companies like Instagram and Airbnb, also continue to use and maintain React, ensuring it remains up-to-date and widely supported.

    Conclusion

    React is a powerful JavaScript library for building dynamic and efficient user interfaces. Its component-based architecture, Virtual DOM, and declarative approach to UI development have made it the go-to choice for modern web development. With its vast ecosystem, cross-platform capabilities, and strong community support, React continues to be a dominant force in the world of web and mobile development.

  • React Tutorial Roadmap

    Introduction to React

    What is React?

    React is a JavaScript library for building user interfaces, primarily used for creating fast, interactive, and component-based web applications.

    History and Origin of React

    React was developed by Facebook (Meta) and released in 2013 to solve challenges related to building large-scale, dynamic user interfaces efficiently.

    Advantages of Using React

    • Component-based architecture
    • Virtual DOM for improved performance
    • Reusable and maintainable code
    • Strong community and ecosystem
    • Widely used in modern frontend development

    Setting Up the Development Environment

    Installing Node.js and npm

    • Installing Node.js
    • Understanding npm (Node Package Manager)

    Creating a React Application

    • Setting up a new project using create-react-app
    • Running and building the development server

    Project Structure

    • Understanding folders and files in a React project
    • Purpose of src, public, and configuration files

    Understanding JSX

    What is JSX?

    JSX is a syntax extension for JavaScript that allows writing HTML-like code inside JavaScript files.

    JSX Syntax

    • Writing JSX elements
    • Using JavaScript expressions inside JSX

    JSX Attributes and Children

    • Applying attributes in JSX
    • Passing children elements

    Components in React

    Types of Components

    • Function components
    • Class components

    Creating and Using Components

    • Creating reusable components
    • Importing and exporting components

    Props

    • Passing data using props
    • Default props and prop validation

    State Management

    • Understanding component state
    • Using the setState method

    Rendering Elements

    Rendering Components

    • Rendering a React component to the DOM

    Updating the UI

    • Re-rendering components when state or props change

    Conditional Rendering

    • Rendering content conditionally using JavaScript expressions

    Handling Events

    Event Handling in React

    • Adding event handlers in JSX
    • Handling user interactions

    Synthetic Events

    • Understanding React’s synthetic event system

    Passing Arguments

    • Passing parameters to event handlers

    Forms in React

    Controlled Components

    • Managing form inputs using state

    Form Submission

    • Handling form submit events

    Using Refs

    • Accessing DOM elements using refs

    Lifting State Up

    State Sharing

    • Sharing state between components

    Lifting State

    • Moving state to a common parent component

    Practical Example

    • Building a temperature calculator

    React Router

    Introduction to React Router

    • Understanding client-side routing

    Navigation

    • Creating navigation using Link and NavLink

    Route Parameters

    • Defining and using dynamic routes

    Context API

    Introduction to Context API

    • Solving prop drilling problems

    Creating Context

    • Creating and providing context values

    Consuming Context

    • Using context in functional components

    Hooks in React

    Introduction to Hooks

    • Why hooks were introduced

    Core Hooks

    • Using useState
    • Using useEffect

    Custom Hooks

    • Creating reusable logic with custom hooks
    • Rules of hooks

    State Management with Redux

    Introduction to Redux

    • Understanding global state management

    Redux Setup

    • Setting up Redux in a React project

    Core Concepts

    • Actions
    • Reducers
    • Store

    Connecting Redux with React

    • Using Redux with React components

    Project Setup

    Planning the Project

    • Defining project requirements
    • Choosing features and structure

    Initial Setup

    • Configuring the React project
    • Organizing folders and files

    Creating Components

    Component Development

    • Creating and styling components

    State and Props

    • Managing component state and props effectively

    Implementing Features

    Routing and Navigation

    • Implementing page navigation

    CRUD Operations

    • Creating, reading, updating, and deleting data

    API Integration

    • Fetching and managing data from external APIs

    Deployment

    Production Build

    • Building the React application for production

    Hosting

    • Deploying the app using Netlify or Vercel