React JS Tutorial - #9 State Up, Props Down
Now that the app is functional, let's take a moment to refactor our code. Apart from a few minor stylistical touches, we'll also re-organize our components, so that the countdown becomes even more modularized and manageable. The Countdown in index.js will be the "master" for the Timer and the Controls (and soon enough, the Datepicker!), and will be the only stateful component in the app. It will house the application data, as well as the behavior (methods) on that data, which will then be passed on demand to other, functional, components. This reflects an important principle of data flow in React: state up, props down.
Our goal is to lift the shared state to the parent ancestor, retain that data local, or encapsulated, to the "master" component, while passing it down through props to the children. Contrast this top-down, or unidirectional flow with two-way binding found in VueJS and Angular. React gives preference to one-way biding because it helps to track down the source where data changes originate, making data flow predictable and maintainable (think Redux, for example).
For your further research endeavors:
"Two way data-binding was a feature in 2013 and Facebook said it was a bug. It turns out they were right." https://medium.com/@chriscordle/why-angular-2-4-is-too-little-too-late-ea86d7fa0bae
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «React JS Tutorial - #9 State Up, Props Down», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.