React Gotchas – Angularity

#ReactJS also has its gotchas:

  • Please enable JavaScript to view the comments powered by Disqus.
  • If you’re using JSX (and most people are), the components you write must begin with an uppercase letter.
  • setState ({ name : ‘Joe’ }, function () { // called after state has been updated // and the component has been re-rendered });
  • The means using names like UserList and Menu and SubmitButton , and not using names like userList , menu , and submitButton .
  • They’ll also get called whenever props change – so if you absolutely want to respond only to state changes, use the callback approach.

Read the full article, click here.


@ReactiveConf: “#ReactJS also has its gotchas:”


Beware these few mistakes that can trip you up.


React Gotchas – Angularity

React Gotchas

#Reactjs Gotchas interesting read

  • If you’re using JSX (and most people are), the components you write must begin with an uppercase letter.
  • They’ll also get called whenever props change – so if you absolutely want to respond only to state changes, use the callback approach.
  • setState({name: ‘ Joe’ }, function () { // called after state has been updated // and the component has been re-rendered });
  • The means using names like UserList and Menu and SubmitButton , and not using names like userList , menu , and submitButton .
  • Another alternative is to use the componentWillUpdate or componentDidUpdate lifecycle hooks, which will be called immediately before and after rendering in response to your state change.

Read the full article, click here.


@devlife411: “#Reactjs Gotchas interesting read”


React Gotchas; Author: Dave Ceddia; Updated: 4 Jul 2016; Section: Client side scripting; Chapter: Web Development; Updated: 4 Jul 2016


React Gotchas