forked from thecodingmachine/react-native-boilerplate
-
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.
Add a directory layout for presentational and container components
It is recommended to [separate presentational and container components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0). Both kind of components will now have their own directory. The content of `App.js` has been moved to a container in order to show an example of a container component.
- Loading branch information
Matthieu Napoli
committed
Jul 9, 2018
1 parent
9b74663
commit 27c9f7a
Showing
6 changed files
with
24 additions
and
4 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React, { Component } from 'react' | ||
import {HomeScreen} from "./Containers/HomeScreen"; | ||
|
||
export default class App extends Component { | ||
render() { | ||
return ( | ||
<HomeScreen/> | ||
) | ||
} | ||
} |
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 @@ | ||
This directory contains [presentational components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0), i.e. React components responsible for the UI of the application. |
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 @@ | ||
This directory contains [container components](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0), i.e. React components responsible for the logic of the application. |
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,4 +1,4 @@ | ||
import { AppRegistry } from 'react-native' | ||
import App from './App' | ||
import App from './App/App' | ||
|
||
AppRegistry.registerComponent('Boilerplate', () => App) |