Finalised Documentation for React Flow:;
Step 01 :: :: :: :: ::
In Browser We type -------------- http://localhost:8080/login
From here We will go to the react front end
Step 02 :: :: :: :: ::
Go to app.js
see the routes....... I do not get it in the login...
Step 03 :: :: :: :: ::
Go to services in the front end....
go to file ---- user.service.js
now go to function login................
now in the function login
we go to the return action::::this:::
function login(email, password) {
return fetch(`${BASE_URL}/sign_in`, requestOptions) :: this sign_in is the route for the backend ......
Step 04 :: :: :: :: ::
Go to Backend :::: routes.rb
in check this sign
-in route and see controller and action for that
post "/sign_in", :to => 'sessions#create'
session controller and create action
Step 05 :: :: :: :: ::
now go to session controller create action and check the code in that.....
Step 06 :: :: :: :: ::
now again come to service.js
service jahan se call hui thi wahan jana hoga humein......
Step 07 :: :: :: :: ::
Step 08 :: :: :: :: ::
Step 09 :: :: :: :: ::
url 8080:login
app.js frontednd route... sabhi route mein se check karega
<Route path="/login" component={AuthPage} />
authpage component.....yeh component import hoga app.js mein...
is par gaya mein... ... pages/auth.js mein aa gaye....
mujhe ismein render par jana hai sabse pehle.....
authform jahan se import ho rha hai wahan dekhenge....kyunki. ismein props diye gaye hain..toh ismein dekhna hoga ki yeh props kahan se aa rahe hain......
components se authform import ho raha hai...
lifecycle component dekha..oehle constructor dekha fir aur dekha cycle se finai mila fir retrun mila..
..........................
lifecycle of react dhyan rakho........sabse pehle construtor call hoga w3schools ko ek bar dhyan se read kar lo....
uske bad getdervied state call hoga.......
ab mein authform mein aya components mein..
authform.js
ab ismein bhi lifecycle dekhiyeh aap.....
main kaam actions and services ka hai...frontend
aur controller and action by route in backend
services se humara data jata hai
action mein ya action ke through aap koi request bhejte ho...
Comments
Post a Comment