mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-13 08:15:06 +01:00
Merge pull request #38 from Kingscliq/master
refactor of if else to tenary for simplicity
This commit is contained in:
commit
7bd4b8a665
@ -5,14 +5,13 @@ import './index.css';
|
||||
|
||||
function Router() {
|
||||
const { streamData } = useMovie();
|
||||
if (streamData) return <MovieView />;
|
||||
else return <SearchView />;
|
||||
return streamData ? <MovieView /> : <SearchView />;
|
||||
}
|
||||
|
||||
function App() {
|
||||
return (
|
||||
<MovieProvider>
|
||||
<Router/>
|
||||
<Router />
|
||||
</MovieProvider>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user