Skip to content

Commit

Permalink
improve the code
Browse files Browse the repository at this point in the history
  • Loading branch information
levchenko-dmytro committed Oct 12, 2023
1 parent 83bc109 commit 9340a8c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import { Movie } from './types/Movie';
export const App = () => {
const [moviesList, setMoviesList] = useState(moviesFromServer);

const addMovie = (movie: Movie) => {
setMoviesList([...moviesList, movie]);
};

return (
<div className="page">
<div className="page-content">
<MoviesList movies={moviesList} />
</div>
<div className="sidebar">
<NewMovie
onAdd={(movie: Movie) => {
setMoviesList([...moviesList, movie]);
}}
/>
<NewMovie onAdd={addMovie} />
</div>
</div>
);
Expand Down

0 comments on commit 9340a8c

Please sign in to comment.