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: content/docs/error-boundaries.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,7 @@ Check out [this example of declaring and using an error boundary](https://codepe
71
71
72
72
## Where to Place Error Boundaries {#where-to-place-error-boundaries}
73
73
74
-
The granularity of error boundaries is up to you. You may wrap top-level route components to display a “Something went wrong” message to the user, just like server-side frameworks often handle crashes. You may also wrap individual widgets in an error boundary to protect them from crashing the rest of the application.
74
+
The granularity of error boundaries is up to you. You may wrap top-level route components to display a “Something went wrong” message to the user, just like how server-side frameworks often handle crashes. You may also wrap individual widgets in an error boundary to protect them from crashing the rest of the application.
75
75
76
76
77
77
## New Behavior for Uncaught Errors {#new-behavior-for-uncaught-errors}
React doesn't need error boundaries to recover from errors in event handlers. Unlike the render method and lifecycle methods, the event handlers don't happen during rendering. So if they throw, React still knows what to display on the screen.
132
132
133
-
If you need to catch an error inside event handler, use the regular JavaScript `try` / `catch` statement:
133
+
If you need to catch an error inside an event handler, use the regular JavaScript `try` / `catch` statement:
Whereas a component transforms props into UI, a higher-order component transforms a component into another component.
16
16
17
-
HOCs are common in third-party React libraries, such as Redux's [`connect`](https://github.com/reduxjs/react-redux/blob/master/docs/api/connect.md#connect) and Relay's [`createFragmentContainer`](http://facebook.github.io/relay/docs/en/fragment-container.html).
17
+
HOCs are common in third-party React libraries, such as Redux's [`connect`](https://github.com/reduxjs/react-redux/blob/master/docs/api/connect.md#connect) and Relay's [`createFragmentContainer`](https://relay.dev/docs/v10.1.3/fragment-container/#createfragmentcontainer).
18
18
19
19
In this document, we'll discuss why higher-order components are useful, and how to write your own.
Copy file name to clipboardExpand all lines: content/docs/reference-react.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ A `React.memo` egy [felsőbb rendű komponens](/docs/higher-order-components.htm
128
128
129
129
Ha a függvény komponensed ugyanazt rendereli ugyanazon propok esetében, csomagold be egy `React.memo` meghívásba, hogy bizonyos esetekben memoizálni tudd az eredményt a teljesítmény fokozása érdekében. Ez azt jelenti, hogy a React kihagyja a komponens renderelését, és újrafelhasználja az utoljára renderelt eredményt.
130
130
131
-
A `React.memo` csak a propok változásait figzeli. Ha a `React.memo`-val körbevett függvényed implementációja rendelkezik egy [`useState`](/docs/hooks-state.html) vagy [`useContext`](/docs/hooks-reference.html#usecontext) horoggal, az újra lesz renderelve, amennyiben az állapot vagy a kontextus megváltozik.
131
+
A `React.memo` csak a propok változásait figyeli. Ha a `React.memo`-val körbevett függvényed implementációja rendelkezik egy [`useState`](/docs/hooks-state.html), [`useReducer`](/docs/hooks-reference.html#usereducer) vagy [`useContext`](/docs/hooks-reference.html#usecontext) horoggal, az újra lesz renderelve, amennyiben az állapot vagy a kontextus megváltozik.
132
132
133
133
Komplex prop objektumok esetében alapértelmezés szerint csak sekély összehasonlítást végez. Ha teljes kontrollt szeretnél az összehasonlítás felett, a második argumentumként megadhatsz egy egyedi összehasonlító függvényt.
0 commit comments