
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@lsky/http-react
Advanced tools
<HttpProvider />$ npm install @lsky/http-react --save
$ yarn add @lsky/http-react
$ yarn add react axios
import React from 'react'
import HttpReact, { Post, Get, HttpProvider } from '@lsky/http-react'
class Index extends React.Component {
render() {
return (
<div>
<HttpReact
url="/test/test"
data={{ param: 'abc' }}
method="post"
onResponse={(response) => { console.log('response: ', response) }}
onError={(error) => console.log('error: ', error)}
onLoading={(loading) => console.log('isLoading: ', loading)}
>
http react
</HttpReact>
<Post
url="/test/test"
data={{ param: 'abc' }}
onResponse={(response) => { console.log('post: ', response) }}
>
post http react
</Post>
<Get
url="/test/test"
params={{ param: 'abc' }}
onResponse={(response) => { console.log('get: ', response) }}
>
post http react
</Get>
<HttpProvider baseURL={"http://localhost:3000"}>
<Post
url="/test/test"
data={{ path: '/test/test' }}
onResponse={(response) => { console.log('post: ', response) }}
>
post http react
</Post>
</HttpProvider>
<Get
url={get.url}
onResponse={(response) => { console.log('get: ', response) }}
loading={<div>loading...</div>}
/>
</div>
)
}
}
| attr | type | default value | desc |
|---|---|---|---|
| method | string | null | http method |
| url | string | null | url |
| debounce | number | 100 | debounce |
| data | string | plain object | URLSearchParams | null | data is the data to be sent as the request body; Only applicable for request methods 'PUT', 'POST', and 'PATCH' |
| params | plain object | null | params are the URL parameters to be sent with the request |
| children | React.ReactChild | null | react node |
| loading | React.ReactNode | boolean | null | show in loading |
| onResponse | (response) => void | null | onResponse |
| onError | (error) => void | null | onError |
| onLoading | (isLoading: boolean) => void | null | onLoading |
| attr | type | default value | desc |
|---|---|---|---|
| url | string | null | url |
| debounce | number | 100 | debounce |
| params | plain object | null | params are the URL parameters to be sent with the request |
| children | React.ReactChild | null | react node |
| loading | React.ReactNode | boolean | null | show in loading |
| onResponse | (response) => void | null | onResponse |
| onError | (error) => void | null | onError |
| onLoading | (isLoading: boolean) => void | null | onLoading |
| attr | type | default value | desc |
|---|---|---|---|
| url | string | null | url |
| debounce | number | 100 | debounce |
| data | string | plain object | URLSearchParams | null | data is the data to be sent as the request body; Only applicable for request methods 'PUT', 'POST', and 'PATCH' |
| params | plain object | null | params are the URL parameters to be sent with the request |
| children | React.ReactChild | null | react node |
| loading | React.ReactNode | boolean | null | show in loading |
| onResponse | (response) => void | null | onResponse |
| onError | (error) => void | null | onError |
| onLoading | (isLoading: boolean) => void | null | onLoading |
FAQs
Unknown package
The npm package @lsky/http-react receives a total of 10 weekly downloads. As such, @lsky/http-react popularity was classified as not popular.
We found that @lsky/http-react 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
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.