useEffect(async () => {
fetchData();
}, []);
const fetchData = async () => {
try {
const response = await fetch('https://api.npms.io/v2/search?q=react');
if (!response.ok) {
throw new Error('Network response was not ok');
}
const result = await response.json();
setData(result);
} catch (error) {
console.error('Error fetching data:', error.message);
}
};
Hello, when i want use fetch i stable received answer ‘Refused to connect to ‘***’ because it violates the following Content Security Policy directive: "connect-src ‘self’ ****’ What this problem and how to decide?