Merge pull request #38 from Kingscliq/master

refactor of if else to tenary for simplicity
This commit is contained in:
James Hawkins 2021-10-23 09:31:12 +01:00 committed by GitHub
commit 7bd4b8a665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -5,14 +5,13 @@ import './index.css';
function Router() { function Router() {
const { streamData } = useMovie(); const { streamData } = useMovie();
if (streamData) return <MovieView />; return streamData ? <MovieView /> : <SearchView />;
else return <SearchView />;
} }
function App() { function App() {
return ( return (
<MovieProvider> <MovieProvider>
<Router/> <Router />
</MovieProvider> </MovieProvider>
); );
} }