🎇 MERN stands for MongoDB, Express, React, Node these four things added to make the stack.While working on a project with this stack we need to add...
For further actions, you may consider blocking this person and/or reporting abuse
Amazing Blog Sourav. Keep it up.
Great work🌟
Bro I got a error please help me
it says setLoginUser is not a function
login.js
`import React ,{useState} from 'react'
import axios from 'axios'
import {useNavigate} from "react-router-dom";
const Login = ({setLoginUser}) => {
const navigate = useNavigate();
const navigateToHome = ()=>{
navigate('/')
};
const [user,setuser] = useState({
email :"",
password :""
})
const handlechange = e =>{
const {name,value}= e.target
}
const log = (e)=>{
axios.post("localhost:8000/user/login",user)
.then((res)=>{
console.log(res.data.message)
console.log(res.data.user);
setLoginUser(res.data.user);
navigateToHome();
}
return (
Login
)
}
export default Login`
in app.js
`
import React ,{useState} from "react";
import './App.css';
import Navbar from './commponent/navbar';
import {BrowserRouter ,Route,Routes} from "react-router-dom";
import Home from "./commponent/pages/Home";
import Dailytask from "./commponent/pages/Dailytask";
import Profile from "./commponent/pages/Profile";
import Calen from "./commponent/pages/challengeComp/Calen";
import Login from './commponent/pages/Login';
import Register from './commponent/pages/Register';
import Logout from './commponent/pages/Logout';
function App() {
const [user ,setLoginUser] = useState({})
return (
<>
);
}
export default App;
`
This is nice for what it is, but would be good to add a note to the top advising people that is is not yet a secure login system. Advising the reader to follow this with looking into adding encryption, tokens, etc will help them make this a secure process.
Great post
Great!!!
Also check this added typescript:
github.com/Apongpoh/MERN-Stack-Use...
Please help me bro
What is CRACO nad what it is used for?
Great work
Where is Security? Where is authentication in registration or login?
How do you start both the servers?
Can't use node index.js or node start for the backend
Please advise
use "npm start" for the backend as well in a different terminal.
Awesome Work
great
Thanks