Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sparkweb
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
sparkweb
Commits
865f123e
Commit
865f123e
authored
Jun 04, 2020
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
65ca0883
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
29 deletions
+18
-29
App.css
src/App.css
+3
-0
App.js
src/App.js
+12
-22
Footer.js
src/Footer.js
+2
-6
index.js
src/index.js
+1
-1
No files found.
src/App.css
View file @
865f123e
@import
'~antd/dist/antd.css'
;
.App
{
.App
{
text-align
:
center
;
text-align
:
center
;
}
}
...
...
src/App.js
View file @
865f123e
import
React
from
'react'
;
import
React
from
'react'
;
import
logo
from
'./logo.svg
'
;
import
{
Button
}
from
'antd
'
;
import
'./App.css'
;
import
'./App.css'
;
function
App
()
{
const
handleClick
=
async
()
=>
{
const
a
=
1
+
2
;
const
response
=
await
fetch
(
'/api/todos'
);
console
.
log
(
a
)
const
json
=
await
response
.
json
();
return
(
console
.
log
(
json
.
data
);
<
div
className
=
"App"
>
<
header
className
=
"App-header"
>
<
img
src
=
{
logo
}
className
=
"App-logo"
alt
=
"logo"
/>
<
p
>
Edit
<
code
>
src
/
App
.
js
<
/code> and save to reload...
.
<
/p
>
<
a
className
=
"App-link"
href
=
"https://reactjs.org"
target
=
"_blank"
rel
=
"noopener noreferrer"
>
Learn
React5
<
/a
>
<
/header
>
<
/div
>
);
}
}
const
App
=
()
=>
(
<
div
className
=
"App"
>
<
Button
type
=
"primary"
onClick
=
{
handleClick
}
>
Click
Me
!<
/Button
>
<
/div
>
);
export
default
App
;
export
default
App
;
src/Footer.js
View file @
865f123e
import
React
from
'react'
;
import
React
from
'react'
;
function
Footer
()
{
function
Footer
()
{
const
handleClick
=
async
()
=>
{
const
response
=
await
fetch
(
'/api/todos'
);
const
json
=
await
response
.
json
();
console
.
log
(
json
.
data
);
}
return
(
return
(
<
div
>
<
div
>
<
button
onClick
=
{
handleClick
}
>
clickme
!<
/button
>
nothing
here
...
<
/div
>
<
/div
>
);
);
...
...
src/index.js
View file @
865f123e
...
@@ -7,8 +7,8 @@ import * as serviceWorker from './serviceWorker';
...
@@ -7,8 +7,8 @@ import * as serviceWorker from './serviceWorker';
ReactDOM
.
render
(
ReactDOM
.
render
(
<
React
.
StrictMode
>
<
React
.
StrictMode
>
<
Footer
/>
<
App
/>
<
App
/>
<
Footer
/>
<
/React.StrictMode>
,
<
/React.StrictMode>
,
document
.
getElementById
(
'root'
)
document
.
getElementById
(
'root'
)
);
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment