Skip to content

Commit

Permalink
Fixed a bug on production (no-cors)
Browse files Browse the repository at this point in the history
  • Loading branch information
HagaiVinik committed Apr 2, 2020
1 parent 48f339b commit 8f62841
Show file tree
Hide file tree
Showing 4 changed files with 175 additions and 19 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
================================================================================================

**NAME:** RobotCards
**DESCRIPTION:** This simple project was created for learning React,
using combination of components, states, and others.
**DATE:** 31/01/20
**AUTHOR:** *Hagai Vinik*

================================================================================================

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts
Expand Down
175 changes: 169 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"name": "robofriends",
"homepage": "https://HagaiVinik.github.io/RobotCards",
"version": "0.1.0",
"private": true,
"dependencies": {
"gh-pages": "^2.2.0",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"react-scripts": "3.1.1",
"tachyons": "^4.10.0"
},
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
Expand Down
5 changes: 2 additions & 3 deletions src/containers/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ class App extends React.Component
}

componentDidMount(){
fetch('https://jsonplaceholder.typicode.com/users')
fetch('https://jsonplaceholder.typicode.com/users', {headers: {'Access-Control-Allow-Origin': '*'}})
.then(response=> response.json())
.then(users=> [this.setState({robots: users})]);
}
onSearchChange = (event) =>
} onSearchChange = (event) =>
{
this.setState({searchField:event.target.value});
}
Expand Down

0 comments on commit 8f62841

Please sign in to comment.