Що таке SHOULDCOMPONENTUPDATE Англійською - Англійська переклад

Приклади вживання Shouldcomponentupdate Українська мовою та їх переклад на Англійською

{-}
  • Colloquial category close
  • Ecclesiastic category close
  • Computer category close
Як я можу реалізувати shouldComponentUpdate?
How do I implement shouldComponentUpdate?
У цьому коді shouldComponentUpdate лише перевіряє наявні зміни в props. color чи state. count.
In this code, shouldComponentUpdate is just checking if there is any change in props. color or state. count.
Count, ви можете виконати цю перевірку в shouldComponentUpdate:.
Count variable changes, you could have shouldComponentUpdate check that:.
Розгляньте можливість використання вбудованого PureComponent замість написання власного shouldComponentUpdate().
Consider using the built-in PureComponent instead of writing shouldComponentUpdate() by hand.
Або ви можете прийняти аргумент, що налаштує shouldComponentUpdate чи джерело даних.
Or you could accept an argument that configures shouldComponentUpdate, or one that configures the data source.
Ми не рекомендуємо робити глибокі порівняння або використовувати JSON. stringify() у shouldComponentUpdate().
We do not recommend doing deep equality checks or using JSON. stringify() in shouldComponentUpdate().
Для C1 і C3 shouldComponentUpdate повернув true, тому React має перейти вниз до листів дерева і перевірити їх.
For C1 and C3, shouldComponentUpdate returned true, so React had to go down to the leaves and check them.
У більшості випадків, замість написання shouldComponentUpdate() вручну, ви можете наслідуватись від React. PureComponent.
In most cases, instead of writing shouldComponentUpdate() by hand, you can inherit from React. PureComponent.
Memo або shouldComponentUpdate, ререндер все одно відбудеться, починаючи з поточного компонента та використовуючи useContext.
Memo or shouldComponentUpdate, a rerender will still happen starting at the component itself using useContext.
Це еквівалентно реалізації shouldComponentUpdate() з поверховим порівнянням поточних та попередніч пропсів та стану.
It is equivalent to implementing shouldComponentUpdate() with a shallow comparison of current and previous props and state.
ShouldComponentUpdate() викликається перед рендерингом при отриманні нових пропсів і стану. За замовчуванням має значення true.
ShouldComponentUpdate() is invoked before rendering when new props or state are being received. Defaults to true.
Це викличе звичайні методи життєвого циклу в дочірніх компонентах,включно з shouldComponentUpdate() для кожного нащадка.
This will trigger the normal lifecycle methods for child components,including the shouldComponentUpdate() method of each child.
Більше про shouldComponentUpdate() і як створювати чисті компоненти ви можете дізнатись прочитавши розділ Оптимізація продуктивності.
You can learn more about shouldComponentUpdate() and how you can build pure components by reading Optimizing Performance.
Для кожного з них SCU позначає значення,повернуте shouldComponentUpdate, і vDOMEq позначає чи були відрендереніReact-елементи рівними.
For each one, SCU indicates what shouldComponentUpdate returned, and vDOMEq indicates whether the rendered React elements were equivalent.
Використовуйте shouldComponentUpdate(), щоб дати знати React, чи поточна зміна стану і пропсів не впливає на виведення компонента.
Use shouldComponentUpdate() to let React know if a component's output is not affected by the current change in state or props.
Незмінні дані надають вам дешевий спосіб відслідковування змін в об'єктах і це саме те,що нам потрібно для реалізації shouldComponentUpdate.
Immutable data structures provide you with a cheap way to track changes on objects,which is all we need to implement shouldComponentUpdate.
Для C6 shouldComponentUpdate повернув true і, оскільки значення відрендерених елементів не було еквівалентним, React має оновити DOM.
For C6 shouldComponentUpdate returned true, and since the rendered elements weren't equivalent React had to update the DOM.
У майбутньому React може розглядати shouldComponentUpdate() як пораду, а не строгу вимогу, і повернення false може спричинити повторний рендеринг компоненту.
In the future React may treat shouldComponentUpdate() as a hint rather than a strict directive, and returning false may still result in a re-rendering of the component.
Це корисно при передачі фукцій зворотнього виклику до оптимізоваих дочірніх компонентів,що покладаються на рівність посилань задля уникнення непотрібних рендерів(наприклад, shouldComponentUpdate).
This is useful when passing callbacks to optimized child components thatrely on reference equality to prevent unnecessary renders(e.g. shouldComponentUpdate).
Оскільки shouldComponentUpdate повернув false для піддерева з коренем в C2, React не буде намагатися відрендерити C2 і навіть викликати shouldComponentUpdate для C4 і C5.
Since shouldComponentUpdate returned false for the subtree rooted at C2, React did not attempt to render C2, and thus didn't even have to invoke shouldComponentUpdate on C4 and C5.
Традиційно, проблеми продуктивності вбудованих функцій у React були пов'язані з тим, якпередача нових функцій зворотнього виклику при кожному рендері порушує оптимізації shouldComponentUpdate у дочірніх компонентах.
Traditionally, performance concerns around inline functions in React have been related to howpassing new callbacks on each render breaks shouldComponentUpdate optimizations in child components.
На відміну від методу shouldComponentUpdate() для компонентів-класів, функція areEqual повертає true, якщо пропси рівні і false, якщо пропси не рівні. Це інверсія shouldComponentUpdate.
Unlike the shouldComponentUpdate() method on class components, the areEqual function returns true if the props are equal and false if the props are not equal.This is the inverse from shouldComponentUpdate.
У більшості випадків це не проблема, але якщо ви помітите, що швидкодіязменшиться, то ви можете прискорити все, перевизначивши метод життєвого циклу shouldComponentUpdate, котрий викликається перед початком процесу повторного рендерингу.
In many cases it's not a problem, but if the slowdown is noticeable,you can speed all of this up by overriding the lifecycle function shouldComponentUpdate, which is triggered before the re-rendering process starts.
Якщо ви знаєте, що в певних ситуаціях ваш компонент не повинен оновлюватись,то ви можете повернути false з shouldComponentUpdate, щоб пропустити весь процес рендерингу, включно з викликом render() поточного компонента та компонентів нижче.
If you know that in some situations your component doesn't need to update,you can return false from shouldComponentUpdate instead, to skip the whole rendering process, including calling render() on this component and below.
Якщо використовуються змінні об'єкти ілогіка умовного рендерингу не може бути реалізована у shouldComponentUpdate(), виклик setState() тільки тоді, коли новий стан відрізняється від попереднього, може запобігти непотрібних повторних рендерингів.
If mutable objects are being used andconditional rendering logic cannot be implemented in shouldComponentUpdate(), calling setState() only when the new state differs from the previous state will avoid unnecessary re-renders.
Результати: 25, Час: 0.0235

Найпопулярніші словникові запити

Українська - Англійська