5, 4, 3, 2...
>> When, now?
Is there an action or something?
Hi, this is Burke Holland.
>> All right, this one.
>> Golnaz!
>> Hey, this is Burke Holland.
>> And I'm Dan Abramov.
>> And this is five things about React.
Thing one. It's great Burke.
Thing one. React is
a JavaScript library for building user interfaces,
created at Facebook by,
>> Jordan Walke.
>> Some time ago, 2011, is that right?
>> So there was a library, an
internal library that Facebook
was using at the time called Bold.js.
And I think React kind of combined some Jordan's ideas
with some of the APIs in Bold just to make
it feel familiar for Facebook developers.
That was a long time ago.
>> Does Jordan still work on React?
>> No, Jordan doesn't work on React anymore.
He is working on Reason,
which is a functional language.
That feels familiar to
JavaScript developers but is actually backed by O'Connel.
>> So that would explain why he
tweets about it all the time.
>> Yeah.
>> Okay.
>> Totally.
>> This is the lushest hair I wish I had.
>> I did too.
Don't tease him about my bonus gonads,
you know how I feel about that.
I don't like being bald. It's well known.
>> Thing number two. The main idea
behind React is components.
What do we mean by components?
>> So you split UI into
independent pieces that are declarative and stateful.
And so every component specifies
what it wants to render and React
takes care of actually using
the platform APIs to update what's
on the screen in response to that.
Usually, UIs have some inherence states like you
might have a bottom that can be toggled or
you might have a text input that can't change or you
might have a network fetch and
the UI changes how it looks over time.
And so React makes state a first class concept.
So you can declare
what the UI should look like with a given state.
>> So everything is a component?
>> Everything is component.
>> You're a component?
>> I'm not a component.
>> I'm a component?
>> No. No, that's not how it works.
>> Thing number three.
Facebook now has over
30,000 React components in production.
Is that right 30,000?
>> That's scary.
>> That's a lot. Where are they all?
>> In the mono repo.
>> Just everywhere in Facebook?
>> Yeah.There is a single repository
and they are all there.
>> All the 30,000 components?
>> All the 30,000 components.
>> Growing every day.
>> Yes.
>> Excellent. Thing number four.
If you're building React apps,
you should probably use Redux.
>> No.
>> No. Don't use Redux.
>> No I mean,
do whatever makes sense.
I have an article called,
"You Might Not Need Redux".
>> Wait. You wrote that article?
>> Yeah.
>> Okay, I thought somebody wrote it.
>> I wrote it.
Because everybody was like use Redux.
I said now wait,
we are supposed to evaluate
technical decisions before making them.
>> So thing number four is use Redux or don't use Redux.
But either way, you should check out
Dan's course on Egghead because it's excellent.
>> Yeah, thank you.
>> Why does this take forever?
>> Welcome.
>> Number five. React Fiber.
What is React Fiber?
>> It was a code name
for a project that we are shipping in a back 16.
So we use the code name because we wrote React from
scratch for this extended version
but with keeping the API intact.
>> Was it because you were bored?
>> Not exactly.
It was because there were
some fundamental restrictions in the old code base.
It was very hard to add features or change some things.
It gave them some new features
and it also set up a foundation
for many other things
that people want to experiment with.
They send it in the next year,
so we rewrote React from
scratch last year.
And it still works.
>> It still works. When can we have it?
Because I looked on the Internet and it said it's
ready and it's rolled out all
at Facebook. But I don't have it.
>> You don't have it.
>> Is it because I'm not cool enough?
>> No.
So I'm actually here for a week
with my team and we're trying to
fix the last issues that
are preventing us from shipping in.
But I think it's going to ship in
two weeks, three weeks maybe.
>> So we're wasting
your time right now with these videos.
You could be fired up.
>> Yeah.
>> Sorry about that.
>> No, I enjoyed it.
>> Let me think how to transition the segment.
>> Say "Twitter questions".
>> All right let's do a question from Twitter.
This question comes to us from Atanus Courtship who asks,
"Why does one still have to use class name versus class?"
>> There is a boring technical reason.
Do I need to say it?
>> Answer Coutship he wants know.
>> Classes are a preserve name in JavaScript,
and so it's actually pretty confusing that
some code that you would expect to work,
it just doesn't compile.
So if you try to do
structure classes are one of the probs,
which people do you like cons curly class comma.
So if you do this with class name it works because it's
a normal identifier but if you put class there it breaks.
And it's just weird there are
small inconsistencies like this.
And since React is mostly
about writing your own components,
we feel that it's kind of important
that it's easy to with.
Like to accept probs,
to do something with them,
to bust them down, and
it felt like too much inconvenience I guess.
I don't know if that is helpful or not.
>> I mean if that's the answer, that's the answer.
I would say the only time that I find it to be
tricky is when I'm copying and pasting code from places.
>> Yeah, but there are tools that. If you google
HDML to GSX converter you can just do this automatically.
>> That's a good tip. You can always "find" and "replace"
but that's a lot of extra work I don't want to do.
>> I don't know I just press
and hold common genes Sublime,
it selects everything and then typing it once.
>> Well, what Courtship,
which he should probably do is submit
a PR to change class to,
from class name to class and then.
>> No thank you, no.
>> No, don't do that.
>> I'm Burke Holland.
>> And I'm Dan Abramov.
>> And now you know five things about React.