GithubHelp home page GithubHelp logo

react-guide's Introduction

react-guide

React adventures

react-guide's People

Contributors

andrei-picus-hs avatar frewsxcv avatar gonzochic avatar jamesmanning avatar mihai-caraman-hs avatar ovidiuch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-guide's Issues

Question: does state have to be serializable?

I also posted this on the React issue list here

According to this guide, all items in the state of a react component have to be serializable. I would like to store a non-plain javascript object, what would be the consequences?

Props change does not re render

As far as I know changing props doesn't cause a component to re render. Props change will trigger componentWillReceiveProps and will only cause a re render if we update the state in this life cycle method?

State can get initial value from parent Component?

I have another question about the table:

- props state
Can get initial value from parent Component? Yes Yes
Can be changed by parent Component? Yes No
... ... ...

While I can understand that with getInitialState (and constructors in es6) I can set the initial state based just on the parent's value, it's still one more step to do**. Even more, here it's stated that in the majority of simple cases having props in getInitialState is an anti-pattern.

I cannot get the main idea of this yes and to my mind it's pretty confusing, so I'm asking for help. What am I missing here?

**What I mean by "one more step" is:
<Button color={'red'}>
...
// and in the button component
this.props.color
But how can I do the same with state?

Are props geometrical properties of a component?

Are they? are they only that?
Are they calculated during the graphical rendering by the browser?
Question from someone new to react, digging in atom sources, and seing @props all over the place and googling his way to your guide.
Nor sure how to submit a question so filed it as an issue. Sorry about that.
Thx for that document.

Licensing?

I found this table discussing the differences between props and state to be extremely helpful! Thanks for putting this guide together.

I've submitted a copy of the table to the official react docs, but I wanted to clarify the licensing. Is there a specific license under which your guide is available?

props cannot change inside Component?

I have one question on this table:

- props state
Can get initial value from parent Component? Yes Yes
Can be changed by parent Component? Yes No
Can set default values inside Component?* Yes Yes
Can change inside Component? No Yes
Can set initial value for child Components? Yes Yes
Can change in child Components? Yes No

We can use 'setProps' in component. So I think props are able to change inside Component?

Thanks for any feedback!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.