
Security News
Official Go SDK for MCP in Development, Stable Release Expected in August
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
react-feature-toggles
Advanced tools
Feature toggle framework for react - down with feature branches
Declarative feature toggle framework for react / react-native, allowing you to get rid of test complications, and branching logic.
npm install --save react-feature-toggles
Wrap your app in the FeatureToggleProvider
and pass in a list of toggles, then use the FeatureToggle
component throughout your application.
Both FeatureToggleProvider
and FeatureToggle
must have only one child, this is so that the library isn't rendering additional elements on your behalf and making assumptions about your needs e.g you may want an <li>
rather than a <div>
.
import React from 'react';
import ReactDOM from 'react-dom';
import { FeatureToggleProvider, FeatureToggle } from '../lib/index';
const toggleNames = {
SHOW_HELLO_WORLD: 'showHelloWorld'
// ... add more here
};
const toggles = {
// Try setting this to true
[toggleNames.SHOW_HELLO_WORLD]: false
// ... add more here
};
const ExampleComponent = () => (
<FeatureToggleProvider featureToggleList={toggles}>
<div>
<h1>Toggling Example</h1>
<FeatureToggle featureName={toggleNames.SHOW_HELLO_WORLD}>
<p>Hello World</p>
</FeatureToggle>
<FeatureToggle featureName={toggleNames.SHOW_HELLO_WORLD} showOnlyWhenDisabled>
<p>Sorry, toggle is off</p>
</FeatureToggle>
</div>
</FeatureToggleProvider>
);
ReactDOM.render(<ExampleComponent />, document.getElementById('example'));
To use with redux you may want to do something like:
const mapStateToProps = state => ({
featureToggleList: state.features,
});
const ConnectedFeatureToggleProvider = connect(mapStateToProps)(FeatureToggleProvider);
And then use the connected provider in place of the normal provider.
npm install
npm run build-example
example/example.html
in the browsernpm run ci-build
firstFAQs
Feature toggle framework for react - down with feature branches
The npm package react-feature-toggles receives a total of 845 weekly downloads. As such, react-feature-toggles popularity was classified as not popular.
We found that react-feature-toggles demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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 official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.
Security News
New research reveals that LLMs often fake understanding, passing benchmarks but failing to apply concepts or stay internally consistent.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.