0.0.1 • Published 3 years ago

@vincere/react-vlag v0.0.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
3 years ago

React Vlag

Getting easy to set feature flag

Add provider to your src/index.js

import { VlagProvider } from '@vincere/react-vlag'

const flags = [
  {
    id: 'beta_feature',
    name: 'Beta Feature',
    description: 'Some texts',
    helperText: '',
    disabled: false
  }
]

<VlagProvider flags={flags}>
  <App />
</VlagProvider>

Hook to check the feature is enabled or not:

import { useVlag } from '@vincere/react-vlag'

const ff = useVlag()

if (ff.isEnabled('beta_feature')) {
  return <BetaFeature />
}

return <ReleasedFeature />

Render prop component to check the feature is enabled or not:

import { Vlag } from '@vincere/react-vlag'

return (
  <Vlag name="beta_feature">
    {isActive => isActive ? <BetaFeatures /> : <ReleasedFeature />}
  </Vlag>
)

How to show toogle feature's page:

import { Features } from '@vincere/react-vlag'
import '@vincere/react-vlag/dist/style.css'

const Pages = () => {
  return (
    <>
      <Features />
    </>
  )
}
0.0.1

3 years ago

0.0.1-rc.4

3 years ago

0.0.1-rc.3

3 years ago

0.0.1-rc.2

3 years ago

0.0.18-rc.1

3 years ago

0.0.17-rc.1

3 years ago

0.0.16-rc.1

3 years ago

0.0.15-rc.1

3 years ago

0.0.14-rc.1

3 years ago

0.0.13-rc.1

3 years ago

0.0.12-rc.1

3 years ago

0.0.11-rc.1

3 years ago

0.0.10-rc.1

3 years ago

0.0.9-rc.1

3 years ago

0.0.8-rc.1

3 years ago

0.0.7-rc.1

3 years ago

0.0.6-rc.1

3 years ago

0.0.5-rc.1

3 years ago

0.0.4-rc.1

3 years ago

0.0.3-rc.1

3 years ago