
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
react-async-render-props
Advanced tools
It is a component to build children by resolving a promise with Render Props pattern.
It is a component to build children by resolving a promise with Render Props pattern.
import AsyncRender, { type ActionType, useActionHandler } from 'react-async-render-props'
function Foo() {
const actionRef = useActionHandler()
return (
<>
<Button onClick={() => {
actionRef.current!.runAsync()
}}>fetch</Button>
<AsyncRender id='fooId' actionRef={actionRef} request={() => {
return new Promise<SelectOption[]>(resolve => {
setTimeout(() => {
resolve([
{
label: Math.random().toString(36),
value: 'xxx'
},
])
}, 500);
})
}}>
{
({ loading, data, runAsync }) => {
return (
<Spin spinning={loading}>
<Button onClick={() => {
runAsync()
}}>fetch</Button>
<ProFormSelect options={data}/>
</Spin>
)
}
}
</AsyncRender>
</>
)
}
export default function App() {
return (
<div>
<div onClick={() => {
AsyncRender.getHandler('fooId').runAsync()
}}>clickme</div>
<Foo />
</div>
)
}
| Name | Type | Description |
|---|---|---|
| request | (...params: P) => Promise\<T\> | Required, A function returning a promise (it will be called when the component is mounted) |
| children | (result: ReturnType\<typeof useRequest\<T, P\>\>) => React.ReactElement | Required, A render props function |
| actionRef | React.MutableRefObject\<ActionType\<T, P\>\> | get useRequest result |
| options | - | useRequest options |
| id | string | mark instance |
| forceUpdate | boolean | force update when fired |
| AsyncRender.getHandler | (id: string) => ActionType | get action handler |
type ActionType<T = any, P extends any[] = any> = ReturnType<typeof useRequest<T, P>> & {
setParam: (partialParam: any, index?: number) => void
}
FAQs
It is a component to build children by resolving a promise with Render Props pattern.
The npm package react-async-render-props receives a total of 5 weekly downloads. As such, react-async-render-props popularity was classified as not popular.
We found that react-async-render-props 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 Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.