🦊 Multiple Components and Conditional Rendering 🦊
Posted on May 24th, 2022
🗓️ Today’s Topics
- Troubleshooting AJAX requests and getting data on the page
- Using multiple components and conditional rendering to create multiple views of your application
🎯 Project
Continue React Trivia. Remember to take it step by step! Don’t try to do too much at once.
For Thursday, make your trivia categories selectable. When selected, you should show at least 10 questions for that category.
If you can get that working, the next step is to show a single question with answer choices. After that you can make the answer choices selectable.
🔖 Resources
- Using the Effect Hook
- React Conditional Rendering
- 5 Ways to Implement Conditional Rendering in React
- Lifting State Up – This is the official doc page. To see it with hooks, watch the video Lifting State Up with Hooks.
- PropTypes in React - This came up in class today so here’s some more info. Checking types for props is especially useful as your application grows, but it’s ok to leave them out for now while you’re still learning React. (There’s a section at the bottom for how to use them with function components.)
CS resources we talked about in class, relevant to 🌳🌳🌳🌳
- BaseCS Medium post about the tree data structure
- BaseCS Series on Medium
- BaseCS Podcast: Don’t Be Stumped…By Trees
- BaseCS Podcast Main Page