Skip to content

Commit

Permalink
add solution
Browse files Browse the repository at this point in the history
  • Loading branch information
hardaira committed Jan 21, 2025
1 parent 96e2fd7 commit a7594b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const initialMovies: Movie[] = moviesFromServer.map(movie => ({ ...movie }));

export const App: React.FC<Props> = () => {
const [movies, setMovies] = useState<Movie[]>(initialMovies);
const addMovie = (newMovie: Movie) => {
const onAdd = (newMovie: Movie) => {
setMovies(currentMovies => [...currentMovies, newMovie]);
};

Expand All @@ -23,7 +23,7 @@ export const App: React.FC<Props> = () => {
<MoviesList movies={movies} />
</div>
<div className="sidebar">
<NewMovie onSubmit={addMovie} />
<NewMovie onSubmit={onAdd} />
</div>
</div>
);
Expand Down

0 comments on commit a7594b2

Please sign in to comment.