Это видео недоступно.
Сожалеем об этом.
React Today and Tomorrow and 90% Cleaner React With Hooks
HTML-код
- Опубликовано: 25 окт 2018
- The first three talks from React Conf 2018 by Sophie Alpert, Dan Abramov, and Ryan Florence.
Learn more about Hooks at reactjs.org/hooks.
44:17 “with hooks we separate code not based on the lifecycle method name but based on what the code is doing” - game changer, Thanks Dan!
love watching dan speak, he clearly loves talking about react and he can explain new features so succinctly. the master.
Its not often that you get to experience the same library for the first time twice. Hats off to the React team for their great work
You can tell by all the people laughing whenever Dan mentions binding functions (and that fact that even he forgets to bind a function) that it has always been a pain point... but hooks will totally remove that boilerplate!!
I'm pretty sure that (and other things Ryan did) were part of the performance. Totally well done because that's how it actually goes!
use arrow functions.
the binding transformation isn't really new, neither is the solution for arrow functions for preserving this.
But does it have a battle royal mode ?
And caravans!
I have the same feeling of excitement watching this than the one I had watching Apple keynotes back in late 00's!
I'm hooked!
Great efforts from the react team and react community. Inspiring. 💙👍🏻
The React team are killing it with Sophie managing. The last year has been incredible for React and it just keeps getting better and better
Ryan Florence is a fantastic presenter
thanks for this amazing library
This API is beautiful. I really don't know how else to describe it. It's just a gorgeous API.
The React team is the only team in this world that i look at and say...'Damn, i wish i was a part of it'. React really rocks, and its always exciting to see what they are coming up with.
nice work... they have been working hard on it...! and they do feel like they are too developers like us not magicians... one of the Greatest Conf I have watch.... Perfect....!!!
So excited, can't wait to use hooks in react 16.7
Ryan is killing it! Funny guy
Algebraic effects FTW
19:49 lmao 🤣🤣🤣
Abramov is a genius a master of React. i thnk that he breathe react
He breathes JS! haha
@@theuniverse685 hahahahahahaha
He is a great speaker even though English is not his first language.
Bye `class`, might the force be with you
Wow it gets a lot loader at around 27 minutes
I love hooks
how little things can make us So Happy...!!!
Awesome work, but I wonder why not let the the sideEffect function to accept parameters what can be parameters of useEffect so the engine don't need to declare a new anonymous arrow function every render. I know it's not a big problem but it has no harm to current pattern and might have a performance improve about maybe less then 0.1%.
Since react is favor of explicitation, then should it be better to explicitly declare what parameters the sideEffect will use instead of reading it from the execution context?
very similar to recompose
What VSC package was Dan and Ryan using during their presentation? 43:03 Is the view I'm mentioning.
I like how there is a blur on the existing code, but that the screens are responsive to one another.
If you're talking about the blur effect when they resize the browser/editor, that's just the macOS Split View feature
I loved it :D
From a functional point of view, I would argue that the 'withState' function from 'recompose' is a better choice than the 'useState' hook, because useState makes the functional component not pure, it takes input from the caller (props) as well as the useState function, whereas withState will merge the state (name, setName) into the props, so the functional component only takes props as input. Also you have to use useState as a statement, so there is no way to write the functional component without a function block (the curly braces).
React for dayz
Great talk, I will start using hooks. One point though, electrons don't orbit :)
Dan 🥇👏🏻👏🏻
Mind = blown
Dan 大神啊
Which group is the group of the react in FB mentioned by the first speaker.
Can anybody please give me details
Anyone know where I could find the code snippets Dan showed off here ?
In the react documentation. They are pretty much the same.
Tom Holland works for Facebook? Interesting...
Why was the binding required at 19:51 ?
That is just how vanilla Javascript works. You need to bind the 'this' keyword so that when the 'handleNameChange' function gets executed the 'this.setState' inside it points to the "right thing" (the constructor of the class), avoiding that 'undefined' error
How is that possible to have a preview embed in the editor like in 17:46?
Its not preview in editor, its a browser 34:57
It's not embedded. It's just text editor and browser running side by side using macOS split view: support.apple.com/en-us/HT204948
Dan, no amount of Frank Ocean fanboying on Twitter is gonna make me forgive you blowing out my ears at 27:10
So, goodbye class components?!
Is that a racoon in the space at @1:12:31
So... is functional setState no longer problematic?
What made functional setState problematic? To my understanding it is less problematic than passing in an object
I think it's a way too move away from using classes and stay consistent with functional programming.
Hooks is the future!
Why hooks instead of decorators?
Richard Torcato decorators only work on classes.
@@pbouzaki Decorators work on functions just fine. I think it's mostly about the data flow, the only way into a component is through its props so a decorator would essentially just create a HOC which a hook doesn't do.
To avoid passing local state and shared state down by props.
So that props has exactly the same hierachy with view structure.
The subscription to shared state and the functionality won't pollute the props.
And stateful functionality can be easily reused and tested.
Sophie is killin it in that dress 👗💕
React vs Vue, who is the leader of the future js framework?
Sophie Alpert is the female version of Dan Abramov
is Dan Abramov Jesus Christ reborn? D:
why not just use class components if your trying to make use of states in function components?
Am I the only one that doesn't like these magical hooks?
And they hold A global state!?
As Dan mentioned, hook is using state the same way how react store your component states.
no, state is local to the component
They do not hold a global state. When you call `useState` react will create a new state and bind that to your component. You can't access it from somewhere else. That is why you must call `useState` or any of the other hooks unconditionally and in the top level of your component function. React maps the states according to the order they appear in your component. So you have to make sure, the order of calls never changes which is best achieved by statically calling them top level. Also every call to `useState` creates an undependent state.
I admit it has some magic how this works but it gets rid of a lot of pain points when working with react in big projects. It allows separation of concerns and an overall better organisation of your code and is less verbose. When used incorrectly it can of course lead to confusion and bugs but in my opinion this is already the case with class based component.