- Controlled Vs Uncontrolled Component
- Controlled components refer to the components where the state and behaviors are controlled by Parent components
- while Uncontrolled components are the ones having control of their own state and manage the behaviors on themselves(useref) (Use ref will update the real dom directly)
- React Hook
- Higher Order Components
- React are a pattern that allows you to reuse component logic. They are functions that take a component and return a new component with additional props or logic. HOCs are commonly used for cross-cutting concerns like authentication, data fetching, and state management
- // This is your HOC
- function withLogger(WrappedComponent) {
- return class extends React.Component {
- componentDidMount() {
- console.log('Component Mounted');
- }
- render() {
- return <WrappedComponent {...this.props} />;
- }
- };
- }
- // Usage of HOC
- class MyComponent extends React.Component {
- render() {
- return <div>Hello, World!</div>;
- }
- }
- const MyComponentWithLogger = withLogger(MyComponent);
- export default MyComponentWithLogger;
- Props Drilling
- How to avoid props Drilling
- Functional Vs Class Components
- How to pass data from parent to child and child to parent
- Imperative Hooks in react
- What is Virtual Dom
- How react is working
- How to acheive life cycle method in function components
- life cycle method
- how to improve the performance of the react appication
- what is BABEL
- Error handling
- Redux architecture flow
- Unit test in React
- Lazy loading in React
- React.Memo VS Usememo
- React.Memo - used in the export default which is similar to pure components or shouldcomponetsupdate life cycle
- Usememo - Its the Hooks in react render only when dependency value changed
- Unmounting is class and function
- In class the unmounting is done in the componentWillUnmount
- In function the useeffect will cleanup in return.
- useEffect(() => {
- let timer = setTimeout(() => {
- setCount((count) => count + 1);
- }, 1000);
- return () => clearTimeout(timer)
- }, []);
- Useeffect Vs Uselayout effect
- Useeffect - Run after render and paint(Non blocked)
- UseLayouteffect - Run after render but before the paint (It will block the rendering Performance)
- Redux store: When the same application open in the multiple windows how the redux store will work
- For each windows have is own instant created . state in one windows will not automation sync.
- Local storage
- Broadcast Channel API
- Backend synk
Thursday, 3 October 2024
React Basic Questions and Answers
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment