Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions topic-4/book-1/04.Favorites.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ const MovieCard: React.FC<MovieCardProps> = ({movie, selectFavourite}) => {
~~~
+ In the same file, replace the lines:
~~~tsx
<IconButton aria-label="add to favourites" onClick={null}>
<FavoriteIcon color="primary" fontSize="large" />
<IconButton aria-label="add to favorites">
<FavoriteIcon color="primary" fontSize="large" />
</IconButton>
~~~
with this:
Expand Down Expand Up @@ -126,7 +126,7 @@ with this:
}
/>
~~~
Until now, a component prop is either a data object or a callback functions. However, in the last excerpt above, a component is the value assigned to the title and avatar props. This is acceptable because a component transpiles to a function. Later we will develop custom components that accept other components as props.
Until now, a component prop is either a data object or a callback function. However, in the last excerpt above, a component is the value assigned to the title and avatar props. This is acceptable because a component transpiles to a function. Later we will develop custom components that accept other components as props.

The above changes cause the following runtime execution flow:
1. On the Home page, the user clicks a movie card's Favourite icon.
Expand Down Expand Up @@ -181,7 +181,7 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
);

~~~
We must restart the development server whenever we nake routing configuration changes:
Expand All @@ -200,9 +200,9 @@ The app has a bug! Try the following sequence:

Commit this work to the repository:
~~~
$ git add -A
$ git commit -m "Add to favourites logic completed; Dummy favourites page."
$ git push origin main
git add -A
git commit -m "Add to favourites logic completed; Dummy favourites page."
git push origin main
~~~

[navigation]: ./img/navigation.png
Expand Down