Skip to Content
Modern Front-End Development for Rails
book

Modern Front-End Development for Rails

by Noel Rappin
June 2021
Intermediate to advanced
398 pages
9h 35m
English
Pragmatic Bookshelf
Content preview from Modern Front-End Development for Rails

Acquiring Data in React with useState

Now we are going to get our React page to also interact by making API calls to server. When last we left our React page in Dynamic Styled Components, it was displaying the seating information for one specific concert. What we’d like it to do now is get that seating information from the server and update it if it changes. This will use the fetch method we’ve already seen, as well as a new React hook called useEffect.

Updating the seating information involves adding the following features to the page:

  • When the React components load, they need to get the current seating status from the server.

  • That status needs to get passed down from the Venue component to the seat component that uses the status to display. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern Front-End Development for Rails, 2nd Edition

Modern Front-End Development for Rails, 2nd Edition

Noel Rappin
Agile Web Development with Rails 6

Agile Web Development with Rails 6

Sam Ruby, David B. Copeland, Dave Thomas

Publisher Resources

ISBN: 9781680508758Errata Page