Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
react-async-child
Advanced tools
React Component to render asynchronously.
import React, { PropTypes } from 'react';
import AsyncChild from 'react-async-child';
import Example from './Example';
const Demo = () => (
<AsyncChild>
{ async () => <Example title={ await myAsyncFunc() }/> }
</AsyncChild>
);
<AsyncChild>
{ async () => <Example { ...(await getProps()) }/> }
</AsyncChild>
<AsyncChild>
{ async () => {
let view;
try {
view = <Example title={ await myAsyncFunc() }/>;
}
catch (error) {
view = <div>{ error.message }</div>;
}
return view;
} }
</AsyncChild>
<AsyncChild>
{ () => new Promise(resolve => setTimeout(() => {
resolve(<Example title='Hello world !'/>);
}, 2000)) }
</AsyncChild>
Here we return an <AsyncChild/>
component in a React Router <Match/>
children prop. When the route is matched, it will wait for the db.find()
async function and then render the result. If the route changes, it will wait again, and rerender again. This will make the transition trigger only after the async function is complete.
const MyAsyncView = ({ components }) => (
<Match
pattern='/some/:id'
children={ ({ matched, params: { id } = {} }) => (
<AsyncChild>
{ async () => (
<ReactCSSTransitionGroup
transitionName='some-transition'
transitionEnterTimeout={ 300 }
transitionLeaveTimeout={ 300 }
>
{ matched ? (
<div key={ id }>
<SomeComponent { ...(await db.find(id)) }/>
</div>
) : null }
</ReactCSSTransitionGroup>
) }
</AsyncChild>
) }
/>
);
An async function that returns a React element.
A React element to render until the async function has not been resolved.
FAQs
React Component to render asynchronously.
The npm package react-async-child receives a total of 1 weekly downloads. As such, react-async-child popularity was classified as not popular.
We found that react-async-child 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.