react interview questions
1) What is JSX

// Instead of putting JavaScript into HTML, JSX allows us to put HTML 
// into JavaScript.

// JSX helps in making the code easier to understand and debug.

2) What is Virtual DOM?

// React keeps a lighweight representaion of the Real DOM in the memory.

// When you make some change, the virtual DOM only changes the specific 
// object in the dom instead all of the objects.

// Virtual Dom understands which area needs to send the update and 
// avoids the other areas.

3) What are React Extensions? Name a few

 React Native // hybrid mobile
 Flux // responsible to attach the state management system

4) What is an Event in React? How do you Create one ?

// An event is an action that can be triggered by a User or any System 
// like pressing a key, or a mouse click. etc

// onClick
// onMouseOver
// onMouseEnter 
// onMouseLeave
// onMouseMove

<button onClick={activateLasers}> 
 Activate Lasers
</button>

5) What are Components in React

// Components are the building blocks of a React application's UI.
// It split up the entire UI into small independent pieces.
// Then it renders each of these components independent of each other 
// without affecting the rest of the UI

6) What is a State in React? Do you implement it? 

// React object that is used to contain data or information about the 
//  component.

// A state can be modified based on the user action or network changes.

// Every time the state of an object changes, React re-renders the 
// components to the browser.

// Initial the state
// Render the state
// Update the state


// class

class BalanceInquiry extends Component {
  constructor(props) {
    super(props);
    this.state = {
      totalIncome: 10,
    };
  }

  render() {
    return <div>totalIncome 
		{this.state.totalIncome}
				</div>;
  }
}

// Function 

import React, { useState } from 'react';

function Example() {
  // Declare a new state variable, which we'll call "count" 
  const [count] = useState(10);
  return (
    <div>
      <p> {count} </p>
    </div>
  );
}

7) What are the Higher-order and Pure Components in React?

// A higher-order component is a function that takes a component and 
//  returns a new component.

// A higher-order component is a class-based component. And it does a 
//  shallow comparison of props and state.

// React components can be considered pure if it renders the same 
//  output for the same state tare and props


8) How do you implement React Routing?

//

import React from "react";
import { BrowserRouter as Router, Route, Routes, Link } from 'react-router-dom'

export default  () => {
  return (
    // Router
    <BrowserRouter>
      <div>
        {/* Nav */}
        <nav>
          <ul>
            <li>
						<Link to="/">Home</Link>
						</li>
            <li>
						<Link to="/about">About</Link>
						</li>
          </ul>
        </nav>
      {/* Routes */}
      <Routes>
        <Route exact path='/' element={<Home />} /> 
        <Route path='about' element={<About />} /> 
      </Routes>
      </div>
    </BrowserRouter>
  );
}


Javascript相关代码片段

nix flake Javascript projects

reset udemy course progress

zod Input file schema with shadcn

wordpress rest api print json pretty

extract string csv js

remove extra space string javascript

count letters in string javascript

exract string js

lazygit nvim

ex:javascript loop

js slice last element

Multiply a number with .17 and round up to .25

sweetalert 2

booking calendar js

process.env is kept

AnimationEvent has no function name specified!

jquery date picker wordpress enque

js check in view

settimeout event in input in javascript in react

node option size

docker react app

React Modal using Dialog

how to create dynamic object in javascript

how to create global variable in postman

javascript interview questions tricky

how to create workflow request in postman

mysql json_extract array

parse response body in postman

query param generator js

jest function async API

React portal

i18next suppoeort react

puppeteer page evaluate

react router dom use navigate

react create array from another array

how to delete global variable in scripts postman

Where does closure variables stored in javascript

Where does local variables stored in javascript

nodejs là gì

addEventListener for multiple selector

js calculate opacity

nodejs create stripe payment from server easy

get child form value in parent viewchild

javascript capitalize every word in a sentence

how to use jquery in moodle

how to handle no internet error in react query

window in not defined in nextjs

cypress find element inside element

app tracking transparency react native permissions

C# Blazor list to json

puppeteer .cache folder not found

css in js

bootstrap next js

creat element js

angular can't bind to ngmodel

sandy liang

Toast Message always appears behind the modal

selenium and javascript

react native textinput should not autofill

form.getfieldvalue does not change antd

javascript zoom to bumber

javascript reduce exercises

array in js mdn

javascript built in priority queue

prevent parent click events from firing

what is intrinsic function in javascript

next js with pnpm

shopify emacs

dynamic scroll longitude antd table

tree vue js

eslint no-undef console

Count documents by field mongo

vertical column checkbox.group antd

dynamically adding class to anGULAR ELEMENT

random integer between 5 and 10 javascript

javascript refresh image src

url change tag javascript

change style using getelementsbyclassname

js uppercase türkçe

javascript sorting array using for loops