Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-awesome-feature-toggles
Advanced tools
Readme
This plugin provides a feature toggle component
Install react-awesome-feature-toggles using npm:
npm install --save react-awesome-feature-toggles
Use setFeatureConfig
to set you config. It accepts an object with keys which will be used as the names of your features. It currently does not (yet) support nested objects
import { setFeatureConfig } from 'react-awesome-feature-toggles'
setFeatureConfig({
"awesome.feature": true,
"disabled.feature": false
})
Now use the <FeatureToggle />
Component to conditionally render children
import { FeatureToggle } from 'react-awesome-feature-toggles'
return (
<div>
<FeatureToggle name="awesome.feature">
This text is rendered
</FeatureToggle>
<FeatureToggle name="disabled.feature">
This text is not rendered
</FeatureToggle>
</div>
)
You can also use <FeatureToggle />
to enable routes conditionally. The disabled routes are taken from the route structure just like as if they do not exist:
import { Route, IndexRoute, match } from 'react-router'
import { FeatureToggle } from 'react-awesome-feature-toggles'
const routes = (
<Route name="home" path="/">
<IndexRoute />
<FeatureToggle name="awesome.feature">
<Route name="route1" path="route1" />
</FeatureToggle>
<FeatureToggle name="disabled.feature">
<Route name="route2" path="route2" />
</FeatureToggle>
</Route>)
This would lead to a router that matches /route1
but not /route2
.
MIT
FAQs
Simple feature toggles for react and react router
The npm package react-awesome-feature-toggles receives a total of 21 weekly downloads. As such, react-awesome-feature-toggles popularity was classified as not popular.
We found that react-awesome-feature-toggles 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.