Q:

Element type is invalid: expected a string or a class/function but got: object

I'm trying to share the same codebase, so I wrote my code in a index.js file, and I've put the same code in the index.ios.js and index.android.js file.
This is the code in index.ios.js:
'use strict';

    import React, { AppRegistry } from 'react-native';
    import MYCLASS from './index';

    AppRegistry.registerComponent('MYCLASS', () => MYCLASS);

This is some of the code in index.js:
export default class MYCLASS extends Component {
  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.title}>
          my text
        </Text>
      </View>
    );
  }
}

A:

I agree you'll need to modify that import of React however it doesn't look like that removes the error. Based on my testing it looks like the module bundler is having a tough time with the index.js in the root of the app. If you change that import to:
import MYCLASS from './index.js'; 
then it will work fine. Anything else (./, ./index) will result in that error. 
I would recommend that you rename that index.js to something else like App.js Main.js etc and update the import statement accordingly. Use index.js when you want to expose resources under an organized namespace (directory). 

