-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chap4: Initialized React and Modify babel settings
flow warning workaround: verekia/js-stack-from-scratch#249
- Loading branch information
1 parent
2e4795d
commit 8e2e6da
Showing
6 changed files
with
116 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
{ | ||
"presets": [ | ||
"env", | ||
"flow" | ||
"flow", | ||
"react" | ||
], | ||
"plugins": [ | ||
"flow-react-proptypes" | ||
] | ||
} |
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,7 @@ | ||
// @flow | ||
|
||
import React from 'react' | ||
|
||
const App = () => <h1>Hello React!!!!</h1> | ||
|
||
export default App |
This file was deleted.
Oops, something went wrong.
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,16 @@ | ||
// @flow | ||
|
||
import 'babel-polyfill' | ||
|
||
import React from 'react' | ||
import ReactDOM from 'react-dom' | ||
|
||
import App from './app' | ||
import { APP_CONTAINER_SELECTOR } from '../shared/config' | ||
|
||
const rootEl = document.querySelector(APP_CONTAINER_SELECTOR) | ||
if (!(rootEl instanceof Element)) { | ||
throw new Error('invalid type') | ||
} | ||
|
||
ReactDOM.render(<App />, rootEl) |
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