Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
354 views
in Technique[技术] by (71.8m points)

reactjs - Fetch laravel8 fortify, sanctum api data and show in react with props

I have laravel backend application running on port 8000. It uses fortify and sanctum package for api and all routes are available for SPA. I have a demo application in next.js which is connecting and working fine with backend part. I am following these examples from github for laravel and next.js https://github.com/ggelashvili/laravel-fortify-spa-backend

But next.js is not what I want to use in the end but REACT. So how could I make this work with react? How can i access the csrf token, login controller of fortify and api data?

I tried to copy all files from https://github.com/ggelashvili/laravel-fortify-spa-frontend to my react app but it shows this error.

TypeError: Cannot set property 'props' of undefined

Once I fetch the data, how can I pass it in a different component with props?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...