You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -265,9 +265,43 @@ In HTML, form elements such as ```<input>```, ```<textarea>```, and ```<select>`
265
265
266
266
With a controlled component, every state mutation will have an associated handler function. This makes it straightforward to modify or validate user input.
267
267
268
+
**[Back to Top](https://github.com/aatul/ReactJS-and-Redux-Questions-Answers/blob/master/README.md#table-of-contents)**
269
+
270
+
---
271
+
272
+
### 11. What is a Higher Order component?
273
+
274
+
A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API. They are a pattern that emerges from React’s compositional nature.
275
+
276
+
A higher-order component is a function that takes a component and returns a new component.
277
+
278
+
HOC’s allow you to reuse code, logic and bootstrap abstraction. HOCs are common in third-party React libraries. The most common is probably Redux’s connect function. Beyond simply sharing utility libraries and simple composition, HOCs are the best way to share behavior between React Components. If you find yourself writing a lot of code in different places that does the same thing, you may be able to refactor that code into a reusable HOC.
268
279
269
280
**[Back to Top](https://github.com/aatul/ReactJS-and-Redux-Questions-Answers/blob/master/README.md#table-of-contents)**
270
281
271
282
---
283
+
284
+
### 12. What is create-react-app?
285
+
286
+
```create-react-app``` is the official CLI (Command Line Interface) for React to create React apps with no build configuration.
287
+
288
+
We don’t need to install or configure tools like Webpack or Babel. They are preconfigured and hidden so that we can focus on the code. We can install it easily just like any other node modules. Then it is just one command to start the React project.
289
+
290
+
```js
291
+
create-react-app my-app
292
+
```
293
+
294
+
It includes everything we need to build a React app:
295
+
- React, JSX, ES6, and Flow syntax support.
296
+
- Language extras beyond ES6 like the object spread operator.
297
+
- Auto prefixed CSS, so you don’t need ```-webkit-``` or other prefixes.
298
+
- A fast interactive unit test runner with built-in support for coverage reporting.
299
+
- A live development server that warns about common mistakes.
300
+
- A build script to bundle JS, CSS, and images for production, with hashes and source maps.
301
+
302
+
**[Back to Top](https://github.com/aatul/ReactJS-and-Redux-Questions-Answers/blob/master/README.md#table-of-contents)**
0 commit comments