
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-flow-control
Advanced tools
React component library for declarative JSX control flow.
react-flow-control aims to replace patterns such as
data && <Component />
or
isBoolean ? <ComponentOne /> : <ComponentTwo />
which when nested and the control flow logic gets more complex can become a nightmare to reason with when reading especially with larger codeblocks within the ternary returns. react-flow-control instead places this logic within renderless JSX elements whose sole perpose is to render its children based on various conditions.
the most basis is the Show component.
// This
function myComponent(){
const {data, loading, error} = useSomeHook()
return (
{
!loading ?
!error ?
(<ThingIActuallyWantToRender /> ):
(<ErrorComponent />)
: ( <LoadingSpinner />)
}
)
}
// becomes
function myComponent(){
const {data, loading, error} = useSomeHook()
return (
<Show when={!loading} fallback={()=> <LoadingSpinner/>}>
<Show when={!error} fallback={()=><ErrorComponent/>}>
<ThingIActuallyWantToRender />
</Show>
</Show>
)
}
react-flow-control also provides utilities for loops, and switches.
If theres a control flow you think could be useful in this pattern please make and issue or pr. All contributions are welcome, in the form of bug fixes, docs, tests aswell as features. Below are some features of this repo for those running this package locally.
FAQs
React component library for declarative JSX control flow
We found that react-flow-control 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.