How to NOT React: Common Anti-Patterns and Gotchas in React

Awesome post on #reactjs common problems and solutions

  • Democlass app extends Component { – constructor(props) { – super(props); – this.state = { – name: ” – }; – this.updateValue = this.updateValue.bind(this); – }updateValue(evt) { – this.setState({ – name: evt.target.value – }); – }render() { – return ( – form – input onChange={this.updateValue} value={this.state.name} / – /form – )…
  • Now you can write components like this — – class App extends Component { – constructor(props) { – super(props); – this.state = { – name: ” – };// Look ma!
  • updateValue = (evt) = { – this.setState({ – name: evt.target.value – }); – }render() { – return ( – form – input onChange={this.updateValue} value={this.state.name} / – /form – ) – } – }Read More —2.
  • However, using certain set of values such as array indexes may break your application or render wrong index) = – Display – {…element} – key={index} – / – ) – }ProblemsWhen children have keys, React uses the key to match children in the original tree with children in the subsequent…
  • The docs also mention this — – Because this.props and this.state may be updated asynchronously, you should not rely on their values for calculating the next state.Another problem is when you have multiple setState calls in a single function, as shown above on line 16 and 20.

What is an anti-pattern? Anti-patterns are certain patterns in software development that are considered bad programming practices. The same pattern may have been considered correct at one point in…
Continue reading “How to NOT React: Common Anti-Patterns and Gotchas in React”

React Native Workshop by Farid Safi Tickets, Fri, Dec 9, 2016 at 9:00 AM

  • Log in or sign up for Eventbrite to save events you’re interested in.
  • Your email will only be seen by the event organizer.
  • Map and Directions: React Native Workshop by Farid Safi at MOMA&CO Amsterdam
  • We are glad to invite you to the first full-day React Native Workshop in the Netherlands, led by an expert instructor from Paris – Farid Safi.
  • At the end of the workshop you will be able to create your own iOS and Android application using JavaScript.

Eventbrite – Frontend Amsterdam presents React Native Workshop by Farid Safi – Friday, December 9, 2016 at MOMA&CO Amsterdam. Find event and ticket information.
Continue reading “React Native Workshop by Farid Safi Tickets, Fri, Dec 9, 2016 at 9:00 AM”