UNPKG

dev-toolkit

Version:

Universal Development Toolkit for React Veterans

18 lines (13 loc) 659 B
// This is the main component that both the client & the server touch first. // // It's likely that this component will stay mostly empty since it sits at the root. // It might contain your chosen routing solution or redux-provider. import React from 'react'; import { isClient } from 'dev-toolkit/settings'; import App from './views/App'; // This should log both on the client and the server. Remove once you understand how it works. console.log(`Client App has run on ${isClient ? 'Client' : 'Server'}... (remove-me)`); const displayName = 'RootComponent'; const component = () => <App />; component.displayName = displayName; export default component;