What I learned from the book: The road to learn React

Sometimes I like to play around with programming books. This time I wanted to give the book “The road to learn React” a try. I can recommend this book to anyone who starts learning react. At the end of this book you will create a clone of the Hackernews website. You can see and download my hackernews clone here. Please follow this post to see how to run this project. Feel free to create PR on Github.


what I learned:


  • create-react-app bootstraps a React application
  • JSX mixes up HTML and JavaScript to define the output of React components in their render methods
  • Components, instances and elements are different things in React
  • ReactDOM.render() is an entry point for a React application to hook React into the
  • PropTypes let you define type checks for components
  • Jest allows you to write unit tests for your components DOM
  • Bult-in JavaScript functionlaities can be used in JSX * map can be used to render a list of items as HTML elements
  • Hot module to see changes in browser without reloading
  • Use this.state and setState() to mange your internal component state
  • Pass functions or class methods to your element handler
  • Use forms and events in React to add interactions
  • Embrace controlled components
  • Compose components with children and reusable components
  • Usage and implementation of ES6 class cmponents and functional stateless components
  • Approaches to style your components
  • ES6 class component lifecycle methods for different use cases
  • ComponentDidMount() for API interactions
  • Conditional renderings
  • Synthetic events on forms
  • Error handling
  • Aborting remote API request
  • ES6

  • Variable declarations with const and let can be used for specific use cases
  • Use const over let in React applications
  • Arrow functions can be used to keep your functions concise
    classes are used to define components in React by extending them
  • Functions that are bound to a class are class methods
  • Destructuring of objects and arrays
  • Default parameters
  • Template strings to compose strings
  • Spread operator for immutable data structures
  • Computed property names
  • Class fields
  • Import and export statements help you to organize your code
  • General

  • Higher-order functions
  • Hacker news api interaction
  • Native fetch browser API
  • Client and server- side search
  • Pagination of data
  • Client-side caching
  • Axios as an alternative for the native fetch API
  • Code organization allows you to scale your application with the best practiices
  • code Playground location src/CodePlayground.js

    How to start the repo

    You can clone the github repo and cd to hackernews run – npm install npm start test run - npm test