Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bodysch-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
DevTeam
org
BodySCH
bodysch-frontend
Commits
ba9793d6
Commit
ba9793d6
authored
4 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Use react query on the login example
parent
32b918ab
No related branches found
No related tags found
2 merge requests
!19
fix type imports
,
!8
Refactor structure
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/App.tsx
+8
-5
8 additions, 5 deletions
src/App.tsx
src/hooks/useLogin.ts
+8
-0
8 additions, 0 deletions
src/hooks/useLogin.ts
with
16 additions
and
5 deletions
src/App.tsx
+
8
−
5
View file @
ba9793d6
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
BrowserRouter
as
Router
}
from
'
react-router-dom
'
;
import
{
BrowserRouter
as
Router
}
from
'
react-router-dom
'
;
import
{
ClientContextProvider
}
from
'
./context
'
;
import
{
UserStateProvider
}
from
'
./context/UserContext
'
;
import
{
UserStateProvider
}
from
'
./context/UserContext
'
;
import
Routes
from
'
./Routes
'
;
import
Routes
from
'
./Routes
'
;
function
App
():
React
.
ReactElement
{
function
App
():
React
.
ReactElement
{
return
(
return
(
<
ClientContextProvider
>
<
UserStateProvider
>
<
UserStateProvider
>
<
Router
>
<
Router
>
<
Routes
/>
<
Routes
/>
</
Router
>
</
Router
>
</
UserStateProvider
>
</
UserStateProvider
>
</
ClientContextProvider
>
);
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/hooks/useLogin.ts
0 → 100644
+
8
−
0
View file @
ba9793d6
import
{
useMutation
}
from
'
react-query
'
;
import
useClientContext
from
'
./useClientContext
'
;
export
default
function
useLogin
()
{
const
client
=
useClientContext
();
return
useMutation
(
'
login
'
,
client
.
client
.
auth
.
login
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment