Last active
April 11, 2019 14:49
-
-
Save jamie-ga/3821cfc86e3b0652bba18e542474c0da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App.js | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Provider } from 'react-redux'; | |
import WishlistApp from './wishlist/App'; | |
import VisaCheckerApp from './visa-checker/App' | |
import TripSearchApp from './trip-search/App' | |
import { store } from './store' | |
const WishlistDOM = document.getElementById('wishlist-app') | |
if(WishlistDOM){ | |
ReactDOM.render( | |
<Provider store={store}> | |
<WishlistApp/> | |
</Provider>, | |
WishlistDOM | |
) | |
} | |
const VisaDOM = document.getElementById('visa-checker-app') | |
if(VisaDOM){ | |
const countryCodes = VisaDOM.getAttribute('data-destinations') | |
const nationality = VisaDOM.getAttribute('data-nationality') | |
ReactDOM.render( | |
<Provider store={store}> | |
<VisaCheckerApp | |
destinations={countryCodes} | |
nationality={nationality} | |
/> | |
</Provider>, | |
VisaDOM | |
) | |
} | |
const TripSearchDOM = document.getElementById('trip-search-app') | |
if(TripSearchDOM){ | |
ReactDOM.render( | |
<Provider store={store}> | |
<TripSearchApp/> | |
</Provider>, | |
TripSearchDOM | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment