Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e620352
commit c19c945
Showing
9 changed files
with
26 additions
and
90 deletions.
There are no files selected for viewing
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
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
3 changes: 2 additions & 1 deletion
3
examples/hot/src/components/app.tsx → examples/hot/src/app.tsx
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import * as React from 'react'; | ||
import { Layout } from './components/layout'; | ||
|
||
export const App: React.SFC<{}> = _props => ( | ||
<div className="ui container"> | ||
<h1>Heya, heya, heya!</h1> | ||
<Layout /> | ||
</div> | ||
); |
10 changes: 3 additions & 7 deletions
10
..._tests__/__snapshots__/app.tests.tsx.snap → ...sts__/__snapshots__/layout.tests.tsx.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`app component renders as expected 1`] = ` | ||
<div | ||
className="ui container" | ||
> | ||
<h1> | ||
Heya, heya, heya! | ||
</h1> | ||
</div> | ||
<h1> | ||
Heya, heya, heya!!! | ||
</h1> | ||
`; |
4 changes: 2 additions & 2 deletions
4
...ot/src/components/__tests__/app.tests.tsx → ...src/components/__tests__/layout.tests.tsx
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as React from 'react'; | ||
|
||
export const Layout: React.SFC<{}> = _props => ( | ||
<h1>Heya, heya, heya!!!</h1> | ||
); |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import { AppContainer } from 'react-hot-loader'; | ||
import { App } from './components/app'; | ||
import './styles/styles.scss'; | ||
import { App } from './app'; | ||
|
||
/** | ||
* Render the app | ||
*/ | ||
function renderApp() { | ||
const rootEl = document.getElementById('root'); | ||
ReactDOM.render( | ||
<AppContainer> | ||
<App /> | ||
</AppContainer>, | ||
rootEl | ||
); | ||
} | ||
const rootEl = document.getElementById('root'); | ||
const render = (Component: React.SFC) => | ||
ReactDOM.render( | ||
<AppContainer> | ||
<Component /> | ||
</AppContainer>, | ||
rootEl | ||
); | ||
|
||
renderApp(); | ||
render(App); | ||
|
||
// Hot Module Replacement API | ||
const anyModule: any = module; | ||
if (anyModule.hot) { | ||
anyModule.hot.accept('./components/app', () => renderApp()); | ||
anyModule.hot.accept('./app', () => render(App)); | ||
} |
This file was deleted.
Oops, something went wrong.