
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
react-fetch
Advanced tools
##React Fetch
##Install
npm install react-fetch
##Props
url
: where to fetch json data fromonSuccess
: function on successfully fetching the dataonError
: function to be called on erroroptions
: object containing parameters for the request (see the fetch spec)##Example
pass an api endpoint and the resulting object will be passed as a prop.
import React from 'react'
import Fetch from 'react-fetch'
export default class App extends React.Component{
render(){
return (
<Fetch url="http://api.openweathermap.org/data/2.5/weather?q=London,uk">
<TestComponent/>
</Fetch>
)
}
}
class TestComponent extends React.Component{
render(){
console.log(this.props)
return <div/>
}
}
React.render(<App />, document.getElementById('app'));
###Rebuilding
Run this to view the example in example/dist
npm run build
FAQs
A component that fetches data from an api
The npm package react-fetch receives a total of 723 weekly downloads. As such, react-fetch popularity was classified as not popular.
We found that react-fetch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.