Estoy haciendo prácticas en React usando API de https://jsonplaceholder.typicode.com/users y todo funciona bien en local server pero cuando mando a subirla en Github con gh-pages tengo un error en consola:
Access to fetch at 'https://jsonplaceholder.typicode.com/users' from origin 'https://fc0l.github.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
el codigo que tengo es:
componentDidMount() {
fetch('https://jsonplaceholder.typicode.com/users')
.then(response => response.json())
.then(users => this.setState({ user: users }));
}