Я подключил свое reactjs приложение к firebase, но когда я его запускаю, я получаю сообщение об ошибке. Как вы решаете решение? Модуль не найден:
Не удалось разрешить ошибку "../../store/actions/authActions" в 'C: \ Users \ 2020 \ marioplan \ sr c \ components \ auth' мой веб-браузер.
Не удается разрешить ошибку "../../store/actions/authActions" в 'C: \ Users \ 2020 \ marioplan \ sr c \ components \ auth' мой веб-браузер.
signın. js
import React, { Component } from 'react';
import {connect} from 'react-redux';
import {signIn} from '../../store/actions/authActions';
import {Redirect} from 'react-router-dom';
class SignIn extends Component {
state={
email:'',
password:''
}
handleChange=(e)=>{
this.setState({
[e.target.id]:e.target.value
})
}
handleSubmit=(e)=>{
e.preventDefault();
//console.log(this.state);
this.props.signIn(this.state);
}
render() {
const {authError,auth}=this.props;
if(auth.uid) return <Redirect to='/' />
return (
<div className="container">
<form onSubmit={this.handleSubmit} className="white">
<h5 className="grey-text text-darken-3">Sign In</h5>
<div className="input-field">
<label htmlFor="email">Email</label>
<input type="email" id="email" onChange={this.handleChange}/>
</div>
<div className="input-field">
<label htmlFor="password">Parola</label>
<input type="password" id="password" onChange={this.handleChange} />
</div>
<div className="input-field">
<button className="btn teal lighten-1 z-depth-0">Login</button>
<div className="red-text center">
{authError ? <p>{authError}</p>:null}
</div>
</div>
</form>
</div>
)
}
}
const mapStateToProps=(state)=>{
return{
authError:state.auth.authError,
auth:state.firebase.auth
}
}
const mapDispatchToProps=(dispatch)=>{
return{
signIn:(kimlik)=>dispatch(signIn(kimlik))
}
}
export default connect(null,mapStateToProps,mapDispatchToProps)(SignIn)
firebase: index. js
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp(functions.config().firebase)
exports.helloWorld = functions.https.onRequest((request, response) => {
response.send("Hello from Firebase!");
});
const createNotification = ((notification) => {
return admin.firestore().collection('notifications')
.add(notification)
.then(doc => console.log('notification added', doc));
});
exports.projectCreated = functions.firestore
.document('projects/{projectId}')
.onCreate(doc => {
const project = doc.data();
const notification = {
content: 'Added a new project',
user: `${project.authorFirstName} ${project.authorLastName}`,
time: admin.firestore.FieldValue.serverTimestamp()
}
return createNotification(notification);
});
exports.userJoined = functions.auth.user()
.onCreate(user => {
return admin.firestore().collection('users')
.doc(user.uid).get().then(doc => {
const newUser = doc.data();
const notification = {
content: 'Joined the party',
user: `${newUser.firstName} ${newUser.lastName}`,
time: admin.firestore.FieldValue.serverTimestamp()
};
return createNotification(notification);
});
});