Comments (7)
Hey @moschap, thank for the kind words.
import GitterMobile from './app'
is just the short of import GitterMobile from './app/index.js'
.
You can check the index.js file.
from gittermobile.
Thanks @terrysahaidak ,
I guessed as much that was what the intent was, but my confusion is that in the file /app/index.js there is only this line of export, export default Root
.
Sorry again if i am asking as obvious question but where is the GitterMobile derived from? or if there are links that you can refer me to, to catch up on the pattern of import.
from gittermobile.
As you can see, it's not just export default Root
class Root extends Component {
render() {
return (
<Provider store={store}>
<View style={{flex: 1}}>
<App />
</View>
</Provider>
)
}
}
export default Root
It exports Component named Root
I defined above.
I could also write export default class Root extends Component { }
.
It all is just a new module syntax, with old one I have to write:
module.exports = Root
.
from gittermobile.
Yes that is correct. Sorry i missed out that part of the code in my earlier question. I understand that part actually.
The part that is confusing me is the GitterMobile in the import statement. I would have assumed that based on the code above the import from index.android.js file would have been import Root from './app'
from gittermobile.
Yeah, but it default export, not named, so I can name the module var whatever I want:
// foo.js
const foo = { }
export default foo
// bar.js
const bar = { }
export bar
// baz.js
import whatEverIwant from './foo' // const someVar = require('./foo')
import {bar} from './bar' // const bar = require('./bar').bar or const {bar} = require('./bar')
So I named my root component in the entry file as GitterMobile for better semantic :)
from gittermobile.
Oh now i understand. Thanks a bunch for the clarification, it all makes sense now.
from gittermobile.
I glad I could help you, @moschap :)
from gittermobile.
Related Issues (20)
- Styling activity feed
- Add gitter room description HOT 1
- Improve message input
- Application settings
- jump to the first unread message
- Get better README.md HOT 1
- Running ios and android on simulator HOT 1
- Error: Unable to resolve module `ListViewDataSource` from `libs\ListView\ExtendedListView.js` HOT 5
- Getting isuue on npm start
- Bestätigen des Zugriffs mithilfe von GitHub Mobile
- Show images in modal
- Fix selecting text in message input
- Allow select text in message HOT 1
- Icon is too small
- A simple question about the gitter redirect URL HOT 7
- Rewrite messages list with the brand new FlatList HOT 1
- Use react-native-router-flux for navigation HOT 1
- v0.6 HOT 2
- Add in-app web-browser
- Formatting issue in README HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gittermobile.