Hereβs how you can build image carousel using two CSS properties.
1. scroll-snap-type
This CSS property is used to control the behavior of scrolling alignment within a container.
In this case, it's set to
β’ x: Refers to the horizontal axis. This property is specific to horizontal scrolling.
β’ mandatory: Indicates that the scrolling will always snap to the nearest snap point.
2. scroll-snap-align: start;
This CSS property defines how an element should be aligned during a scroll operation. In this case, it ensures that each image starts at the beginning of the carousel.
1. scroll-snap-type
This CSS property is used to control the behavior of scrolling alignment within a container.
In this case, it's set to
x mandatory, which means:β’ x: Refers to the horizontal axis. This property is specific to horizontal scrolling.
β’ mandatory: Indicates that the scrolling will always snap to the nearest snap point.
2. scroll-snap-align: start;
This CSS property defines how an element should be aligned during a scroll operation. In this case, it ensures that each image starts at the beginning of the carousel.
π2
60+ React.js Interview Questions
[ For both Beginners & Experienced ]
β©
[ For both Beginners & Experienced ]
β©
π1
Level: Beginner to Medium
Topics:
β Introduction
β JSX
β Virtual DOM
β Components
β States and Props
β Data Binding
β Component Rendering
β Introduction to Hooks
Topics:
β Introduction
β JSX
β Virtual DOM
β Components
β States and Props
β Data Binding
β Component Rendering
β Introduction to Hooks
π₯1
β Introduction
β What is React?
β What are the latest features introduced recently?
β What are the core features of React?
β What are the advantages of using React?
β Where shouldn't we use React?
β What are different rendering techniques?
β Difference: CSR v/s SSR
β What is React?
β What are the latest features introduced recently?
β What are the core features of React?
β What are the advantages of using React?
β Where shouldn't we use React?
β What are different rendering techniques?
β Difference: CSR v/s SSR
π₯1
β What is SPA? How does it work?
β When may an SPA run slower?
β What is SSR?
ββ Does React support SSR?
ββ What is SSG?
ββ Key differences between SSR and SSG.
ββ What is RSC (React Server Components)?
ββ How does an RSC work?
β When may an SPA run slower?
β What is SSR?
ββ Does React support SSR?
ββ What is SSG?
ββ Key differences between SSR and SSG.
ββ What is RSC (React Server Components)?
ββ How does an RSC work?
π₯1
β JSX
β What is JSX?
β Can a JSX code directly run on a browser?
β What do we need to convert JSX code to plain-JS code?
β Is "import React from react" necessary? If yes, when?
β Write a sample JSX code and convert it to its equivalent JavaScript.
β What is JSX?
β Can a JSX code directly run on a browser?
β What do we need to convert JSX code to plain-JS code?
β Is "import React from react" necessary? If yes, when?
β Write a sample JSX code and convert it to its equivalent JavaScript.
π₯1
β Virtual DOM
β What is a Virtual DOM?
β Why does React use a Virtual DOM?
β Advantages of Virtual DOM over normal DOM?
β Explain how the Virtual DOM works.
β When and how are changes propagated to the real DOM?
β What is a Virtual DOM?
β Why does React use a Virtual DOM?
β Advantages of Virtual DOM over normal DOM?
β Explain how the Virtual DOM works.
β When and how are changes propagated to the real DOM?
π₯1
β Components
β What is a component?
β How many ways can a component be defined?
β How to define a class-based component?
β How to define a function-based component?
β What are the advantages and disadvantages of defining a component function-based vs. class-based?
β What is a component?
β How many ways can a component be defined?
β How to define a class-based component?
β How to define a function-based component?
β What are the advantages and disadvantages of defining a component function-based vs. class-based?
π₯1
β
Explain the life cycle of a component.
β What is a life cycle method and what is its purpose?
β Give examples of some life cycle methods and their usage.
β What is a life cycle method and what is its purpose?
β Give examples of some life cycle methods and their usage.
π₯1
β States and Props
β What is a state?
β What is a prop?
β Difference between a state and a prop?
β What is a stateful component and a stateless component?
β What is a state?
β What is a prop?
β Difference between a state and a prop?
β What is a stateful component and a stateless component?
π₯1
β How states are set in a class-based component?
β How states are set in a function-based component?
β How to define props in a class-based component?
β How to define props in a function-based component?
β Explain the behavior when a state's value is changed.
β How states are set in a function-based component?
β How to define props in a class-based component?
β How to define props in a function-based component?
β Explain the behavior when a state's value is changed.
π₯1
β Data Binding
β What is data binding?
β What are the different types of data binding?
β What kind of data binding does React allow?
β Which data is available for binding in React?
β What is data binding?
β What are the different types of data binding?
β What kind of data binding does React allow?
β Which data is available for binding in React?
π₯1
β Component Rendering
β What do you mean by rendering a component?
β Where to define rendering logic in a class-based component v/s function-based component?
β What may cause the rendering process slower?
β What is rerendering of a component and when does it happen?
β What do you mean by rendering a component?
β Where to define rendering logic in a class-based component v/s function-based component?
β What may cause the rendering process slower?
β What is rerendering of a component and when does it happen?
π₯1
β Introduction to Hooks
β What is a hook?
β Name the hooks which React provides out-of-the-box.
β What are the general conventions for naming a hook?
β From where can a React hook be called?
β Point out a few places where a hook can't be used.
β What is useState?
β What is a hook?
β Name the hooks which React provides out-of-the-box.
β What are the general conventions for naming a hook?
β From where can a React hook be called?
β Point out a few places where a hook can't be used.
β What is useState?
π₯1