React supported
libraries & Integration
libraries & Integration
Interview Question
192. What is reselect and how it works?
*Reselect* is a **selector library** (for Redux) which uses *memoization* concept. It was originally written to compute derived data from Redux-like applications state, but it can't be tied to any architecture or library.
Reselect keeps a copy of the last inputs/outputs of the last call, and recomputes the result only if one of the inputs changes. If the the same inputs are provided twice in a row, Reselect returns the cached output. It's memoization and cache are fully customizable.
193. What is Flow?
*Flow* is a *static type checker* designed to find type errors in JavaScript. Flow types can express much more fine-grained distinctions than traditional type systems. For example, Flow helps you catch errors involving `null`, unlike most type systems.
194. What is the difference between Flow and PropTypes?
Flow is a *static analysis tool* (static checker) which uses a superset of the language, allowing you to add type annotations to all of your code and catch an entire class of bugs at compile time. PropTypes is a *basic type checker* (runtime checker) which has been patched onto React. It can't check anything other than the types of the props being passed to a given component. If you want more flexible typechecking for your entire project Flow/TypeScript are appropriate choices.
195. How to use Font Awesome icons in React?
The below steps followed to include Font Awesome in React:
1. Install `font-awesome`:
```console
$ npm install --save font-awesome
```
2. Import `font-awesome` in your `index.js` file:
```javascript
import 'font-awesome/css/font-awesome.min.css'
```
3. Add Font Awesome classes in `className`:
```javascript
render() {
return <div><i className={'fa fa-spinner'} /></div>
}
```
196. What is React Dev Tools?
*React Developer Tools* let you inspect the component hierarchy, including component props and state. It exists both as a browser extension (for Chrome and Firefox), and as a standalone app (works with other environments including Safari, IE, and React Native).
The official extensions available for different browsers or environments.
1. **Chrome extension**
2. **Firefox extension**
3. **Standalone app** (Safari, React Native, etc)
197. Why is DevTools not loading in Chrome for local files?
If you opened a local HTML file in your browser (`file://...`) then you must first open *Chrome Extensions* and check `Allow access to file URLs`.
Comments
Post a Comment
please do not enter any spam link in the comment box