Answer the question
In order to leave comments, you need to log in
Why is email & password undefined?
At first I thought that maybe I connected the store incorrectly, but maybe the error is not in it? I went to the react-native-navigation dock and checked if everything was correct. But it still doesn't matter. What am I doing wrong?
reducers/user
import { ADD_USER } from "../actions/actionTypes";
const initialState = {
username: '',
password: ''
};
const reducer = (state = initialState, action) => {
switch (action.type) {
case ADD_USER:
return {
...state,
email: action.email,
password: action.password
}
break;
default:
return state;
}
};
export default reducer;
import configureStore from "./src/store/configureStore";
const reduxStore = configureStore();
// Register screens
Navigation.registerComponent('remote-control.AuthScreen', () => (props) => (
<Provider store={reduxStore}>
<AuthScreen {...props} />
</Provider>
), () => AuthScreen);
import { Provider } from "react-redux";
import configureStore from "./src/store/configureStore";
const store = configureStore();
const RNRedux = () => {
<Provider store={store}>
<App />
</Provider>
};
AppRegistry.registerComponent(appName, () => RNRedux);
import React, { Component } from "react";
import { connect } from "react-redux";
import axios from "axios";
import { addUser } from "../../store/actions/index";
const mapDispatchToProps = dispatch => {
return {
onAddUser: (email, password) => dispatch(addUser(email, password))
}
};
class Auth extends Component {
render() {
return (
<View>
<Text>{`${this.props.email}, ${this.props.password}`}</Text>
<DefaultInput placeholder="Email" value={this.state.email} onChangeText={this.changeEmailLoginData}/>
<DefaultInput placeholder="Password" value={this.state.password} onChangeText={this.changePasswordLoginData}/>
<DefaultButton onPress={this.loginHandler}>Sign in</DefaultButton>
</View>
);
}
}
export default connect(null, mapDispatchToProps)(Auth);
Answer the question
In order to leave comments, you need to log in
"I have never worked with PHP frameworks" and "1. Emphasis on speed" are mutually exclusive ;)
I.e. to write a truly optimized application - you have to study it a lot and deeply.
> I didn't work with PHP frameworks at all > I don't
know the language very well
All the rake will be yours, no options. Take the framework that seems simpler and more understandable to you.
Phalcon
And fast, due to a one-time compilation in C (when the server starts).
And simple.
And the documentation has a good example of how to work with it.
-------------
I do not praise and do not impose. Yes, for an option.
-------------
In general, no matter what framework you take, it will not work without * sheep code .. And again, * sheep code - * sheep code - strife.
Even your current allegedly not * sheep code - in 0.5 - 1 year it will seem to you * sheep code.
If you need to start quickly, then this one is very good: Fat-Free Framework
It seemed to me that the entry threshold is very low and fast enough (support for various caches out of the box). Very quickly, you can mold what you need, and if the project succeeds, then you can move on to something more serious.
I need the framework to fit these points:
1. Emphasis on the speed of the framework. Higher is better.
2. Low entry threshold.
3. Fast development.
4. The ability to scale well, because I don’t know how long the project will shoot, and whether it will shoot at all.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question