1) What is React and how is it different from other Javascript frameworks ?
React is a JavaScript library for building web applications with rich user interfaces and was developed by Facebook.
In the context of MVC (Model View Controller), React is just the View.
The latest version of React is called ReactJS
React is not a "framework" it is a library for creating UI components.
It can also be used on the server using node.js
React Fiber is the new and latest version
React Native is for building apps for mobile devices

2) What is React Native ?
React is completely independent from the browser.
React DOM is used when running in a browser.
React Native is used when running on mobile devices.

3) What is JSX ?
It is designed to simplify working with React components.
What looks like HTML is just a familiar XML syntax that is used to define a component and its position inside the markup.

4) What is the Virtual DOM ?

5) What is Redux ?
Redux is a State Manager.
React can manage its own state but for large applications moving all the state up, and then down using props, will add a lot of complexity.
Redux allows you to move the state to an external global store.

6) What is 'react-hot-loader' ?
This is a webpack plugin that allows react components to be live reloaded.

7) What are Styled Components ?
Styled components are components that include regular CSS inside them instead of referring to a separate file.
This method has become known as "CSS-In-JS".
CSS-In-JS is the sucessor to CSS Modules.

8) What is the React Router API ?
This is a library that resolves the 'broken back button' problem and uses the History API.

9) What are React Hooks ?

10) What is the Context API ?
Added in React 16.3.0

11) Can you describe the various different ways you can use CSS to style a React component ?

12) What is the difference between a Functional component and a Class component ?

13) Can you describe how to pass data from a parent to a child ?
Create a state in the parent
Pass in the state from the parent as a property to the child
We must update the parent state from the parent, not the child
Pass the parents methods into the child as a property.

14) Can you describe the different frameworks or approaches for testing React components ?
Jest - JavaScript test runner created by Facebook
React-Testing-Library - A set of helpers
Mocha - JavaScript test framework for Node.js
Chai -
Enzyme - Testing utility for React
Karma - JavaScript test runner
(Protractor is for testing Angular)

15) Do you have any best practices
All React components must have a name that starts with a capital letter.
When passing in numbers as properties, enclose the numbers in curly brackets
When you use the arrow function short syntax you need to use brackets (not curly brackets)
When calling class member methods from inside the render function you need to enclose them in curly brackets.

© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrev