Q11. How do you conditionally render components?
In some cases you want to render different components depending on some state. JSX does not render `false` or `undefined`, so you can use conditional _short-circuiting_ t...
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 (71 available).
In some cases you want to render different components depending on some state. JSX does not render `false` or `undefined`, so you can use conditional _short-circuiting_ t...
When we _spread props_ we run into the risk of adding unknown HTML attributes, which is a bad practice. Instead we can use prop destructuring with `...rest` operator, so ...
There are memoize libraries available which can be used on function components. For example `moize` library can memoize the component in another component. ```jsx harmony...
React is already equipped to handle rendering on Node servers. A special version of the DOM renderer is available, which follows the same pattern as on the client side. `...
A _switching component_ is a component that renders one of many components. We need to use object to map prop values to components. For example, a switching component to ...
If you are rendering your component using JSX, the name of that component has to begin with a capital letter otherwise React will throw an error as an unrecognized tag. T...
**Note:** This question references React v16, which is outdated. The information below applies to React 16+, including current versions (React 18/19). Yes. Starting with ...
You can simply use `Array.prototype.map` with ES6 _arrow function_ syntax. For example, the `items` array of objects is mapped into an array of components: ```jsx harmony...
React (or JSX) doesn't support variable interpolation inside an attribute value. The below representation won't work: ```jsx harmony ``` But you can put any JS expression...
You shouldn't use curly braces inside quotes because it is going to be evaluated as a string. ```jsx harmony ``` Instead you need to move curly braces outside (don't forg...
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.