Code Monkey home page Code Monkey logo

peckish's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

peckish's Issues

Two separate routes on one page

With your approach of having routes as an array in the navigationState reducer, how would you navigate to two different routes on the same page.
For example, let's say that I have two different TouchableHighlights, with the first navigating forward to Page 1 and the second navigating forward to Page 2.

NavigationExperimental has been removed

Hello Jon,

(first of all, thanks a lot for your videos, I've learned a lot).
I'm currently following your "Getting Started with React Native and Redux" videos. (Step 10)
NavigationExperimental has been removed 8 days ago. (facebook/react-native@febf3d0)

Have you planned to fix this problem by replacing the navigation example ?

Meanwhile I'll try to find out other way to implement the tab navigation functionnality.

Thanks by advance,

Regards.

Element type is invalid

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. Check the render method of SceneContainer.
Can you help me? @jlebensold
` import React,{Component} from 'react'
import {connect} from 'react-redux'
import {ActionCreators} from '../actions'
import {bindActionCreators} from 'redux'
import Home from './Home'
import SubCategories from './SubCategories'

import {
Animated,
StyleSheet,
View,
NavigationExperimental
} from 'react-native';

const {
PropTypes: NavigationPropTypes,
StateUtils: NavigationStateUtils,
Card: NavigationCard,
Transitioner: NavigationTransitioner,
} = NavigationExperimental;

const {
PagerPanResponder: NavigationPagerPanResponder,
PagerStyleInterpolator: NavigationPagerStyleInterpolator,
} = NavigationCard;

class AppContainer extends Component{

constructor(props) {
super(props);
this._render = this._render.bind(this);
this._renderScene = this._renderScene.bind(this);
}

render(){
console.log(this.props);
return
}

_render(transitionProps) {
const scenes = transitionProps.scenes.map((scene) => {
const sceneProps = {
...transitionProps,
scene,
};
return this._renderScene(sceneProps);
});
return (
<View style={ { flex: 1 } }>
{scenes}

);
}

 _renderScene(sceneProps){
   return <SceneContainer {...sceneProps} key={sceneProps.scene.key}/>
 }

}
class SceneContainer extends Component {
render(){
const style = [
styles.scene,
NavigationPagerStyleInterpolator.forHorizontal(this.props),
]
let Scene = null;
if(this.props.scene.route.key === 'Home') { Scene = Home }
if(this.props.scene.route.key === 'SubCategories') { Scene = SubCategories }

return(
  <Animated.View style={style}>
      <Scene {...this.props} style={style} />
  </Animated.View>
);

}
}

const styles = StyleSheet.create({
scene:{
flex:1,
position:'absolute',
bottom:0,
top:0,
left:0,
right:0,
}
})

function mapStateToProps(state) {
return {
navigationState: state.navigationState
};
}

function mapDispatchToProps(dispatch) {
return bindActionCreators(ActionCreators, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(AppContainer);
`

Element type is invalid

i run that code:

 import React, { Component } from 'react'
 import ReactNative from 'react-native'
 const {
    View,
    Text,
 } = ReactNative

class AppContainer extends Component{

render(){
	return <View>
		<Text style={{marginTop: 20}}>
		I am app container
		</Text>
	</View>
            }

 } 


  export default AppContainer`

i got this error: ExceptionsManager.js:63 Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of App.

how can i solve?

A valid React element (or null) must be returned.

I'm trying to implement Redux with react-navigation module, but no matter what I do in the part to implement Provider, it will result in the error.

import React from 'react'
import { AppRegistry } from 'react-native'
import { TabNavigator } from 'react-navigation'
import { Provider } from 'react-redux'
import { createStore, applyMiddleware, combineReducers, compose } from 'redux'
import { createLogger } from 'redux-logger'
import thunkMiddleware from 'redux-thunk'
import reducer from './app/reducers'
import Routes from './app/config/routes'

const loggerMiddleware = createLogger({ predicate: (getState, action) => __DEV__ })

function configureStore(initialState) {
  const enhancer = compose(
    applyMiddleware(
      thunkMiddleware,
      loggerMiddleware
    )
  )

  return createStore(reducer, initialState, enhancer)
}

const store = configureStore({})

const PrettyPenny = TabNavigator({ ...Routes })

const App = () => {
  <Provider store={store}>
    <PrettyPenny/>
  </Provider>
}

AppRegistry.registerComponent('PrettyPenny', () => App)

Thanks.

Could not find "store" in either the context or props of "Connect(AppContainer)".

Getting this error in AppContainer.js
After include the redux connect
export default connect(state => { return{} }, mapDispatchToProps )(AppContainer);

Check this screenshot -> https://cloud.githubusercontent.com/assets/16603533/21046818/7af654da-be2c-11e6-9dd8-cc1b6e575325.png

Dependencies are -> "dependencies": {
"react": "15.4.1",
"react-native": "0.39.1",
"react-redux": "^4.4.6",
"redux": "^3.6.0",
"redux-logger": "^2.7.4",
"redux-thunk": "^2.1.0"
},
"devDependencies": {
"babel-jest": "17.0.2",
"babel-preset-react-native": "1.9.0",
"jest": "17.0.3",
"react-test-renderer": "15.4.1"
}

Element type is invalid (When adding ApplicationTabs)

I am getting the error that was initially shown in your tutorial video here :

https://youtu.be/6zVGVHWklg8?t=6m1s

I have named the file correctly "/app/containers/ApplicationTabs/index.ios.js" and the file contents are exactly as shown in the tutorial. However where the app worked in your video once you connected ApplicationTabs I am still getting that error after doing so myself.

I am using a newer version of a lot of the react/react-native/redux modules however.

I am not sure if the convention of exporting with files named with "index.ios.js" has changed or anything? Any help you could provide would be greatly appreciated.

Below is my package.json dependencies :
"dependencies": { "react": "15.4.2", "react-native": "0.40.0", "react-redux": "^5.0.2", "redux": "^3.6.0", "redux-logger": "^2.7.4", "redux-thunk": "^2.2.0" }

And this is my /app/containers/ApplicationTabs/index.ios.js file contents :
import { View, TabBarIOS, TabBarItemIOS } from 'react-native'; import React, { Component } from 'react'; import { connect } from 'react-redux'; class ApplicationTabs extends Component { render() { return ( <View /> ); } } function mapStateToProps(state) { return { }; } export default connect(mapStateToProps)(ApplicationTabs);

And the contents of AppContainer :
import React, {Component} from 'react'; import {connect} from 'react-redux'; import {ActionCreators} from '../actions'; import {bindActionCreators} from 'redux'; import ApplicationTabs from './ApplicationTabs'; class AppContainer extends Component { render() { return ( <ApplicationTabs { ...this.props } /> ) } } function mapDispatchToProps(dispatch) { return bindActionCreators(ActionCreators, dispatch); } export default connect( () => { return {} }, mapDispatchToProps)(AppContainer);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.