Q71. How to pretty print JSON with React?
We can use `` tag so that the formatting of the `JSON.stringify()` is retained: ```jsx harmony const data = { name: "John", age: 42 }; function User { return {JSON.string...
Technical Question Bank · Peer-Reviewed
Search and filter frequently asked interview questions across technical, programming, and behavioral domains. Tailor your interview preparation by difficulty for freshers or experienced developers (454 available).
We can use `` tag so that the formatting of the `JSON.stringify()` is retained: ```jsx harmony const data = { name: "John", age: 42 }; function User { return {JSON.string...
The React philosophy is that props should be _immutable_(read only) and _top-down_. This means that a parent can send any prop values to a child, but the child can't modi...
You need to use `useEffect` hook to set focus on input field during page load time for functional component. ```jsx harmony import React, { useEffect, useRef } from "reac...
You can use `React.version` to get the version. ```jsx harmony const REACT_VERSION = React.version; ReactDOM.render( {`React version: ${REACT_VERSION}`}, document.getElem...
Add a listener on the `history` object to record each page view: ```javascript history.listen(function (location) { window.ga("set", "page", location.pathname + location....
React _does not_ apply _vendor prefixes_ automatically. You need to add vendor prefixes manually. ```jsx harmony ```
You should use default for exporting the components ```jsx harmony import User from "user"; export default function MyProfile { return //...; } ``` See Class ```jsx harmo...
The component names should start with an uppercase letter but there are few exceptions to this convention. The lowercase tag names with a dot (property accessors) are sti...
Yes, you can use `async/await` in plain React, as long as your JavaScript environment supports ES2017+. Nowadays most modern browsers and build tools support ES2017+ vers...
There are two common practices for React project file structure. 1. **Grouping by features or routes:** One common way to structure projects is locate CSS, JS, and tests ...
HireXTech uses essential storage to remember your study preferences and third-party advertising cookies via Google AdSense in compliance with GDPR. You can choose to enable essential cookies only or accept all cookies. Read our Privacy Policy.