FREELessons: 11Length: 1.7 hours

Next lesson playing in 5 seconds

Cancel
  • Overview
  • Transcript

7.1 Conclusion

Before I leave you, here are some tips to remember as you’re coding your components:

  • Use JSX instead of the factory methods in the React API.
  • Extend your components by composing them as higher-ordered components.
  • Write your component as a stateless function unless you absolutely need to maintain state.
  • When handling events or passing functions to other components, be sure to bind the this keyword to the appropriate object.
  • The most common way to incorporate Ajax into your component is with a higher-order component.

React is probably my favorite framework to date, and I hope I’ve passed a little of that excitement on to you. Please feel free to contact me via Twitter or the Envato Tuts+ forum if you have any questions.

7.1 Conclusion

React is probably my most favorite library to date and it's my hope that I've passed just even a little of that on to you. React is a fantastic framework for building user interfaces because it makes sense to compose a UI from smaller and focused components. Well before I leave you, here are some tips to remember as you are writing your own components. First of all, use JSX instead of the factory methods in the React API. Extend your components by composing them as higher ordered components. Doing so gives you more flexibility as opposed to class based inheritance. And be mindful of states, because not every component needs to be stateful. So write your component as a function, unless you absolutely need to maintain state. Stateless components are more efficient than stateful components. When handling events or passing functions to other components be mindful of what object that function is bound to. If you use the vis keyword in that function you need to bind it to the appropriate object. There are many ways to incorporate Ajax into your components. But probably the most common way is to make the request in a parent or container component and pass the resulting data to the child component that needs that data. Thank you so much for watching this course. Please feel free to contact me via Twitter or the Touchplus forums if you have any questions. From all of us here at Touchplus, thank you, and I will see you next time.

Back to the top