v2.0.2
Duplicate of V2.0.0 with package-lock changes (this is the version published to npm)
What's new
This version reworks how React-flagpack works to work with public assets instead of inject flags through javascript.
This should ensure that React-flatpack works properly with any React library/framework as long as it supports rendering images.
This version has some breaking changes which require changes to your setup/cli, follow the migrating to 2.0.0 guide to get started.
Migrating to 2.0.0
To migrate to react-flagpack 2.0.0 you will need to make some minor changes to your code base. First you will need to add react-flagpack to your post-install hook see installation, then run yarn install (ensuring you are on at minimal react-flagpack 2.0.0).
After install you should see a flags folder in the public (or static) folder of your project.
Since react-flagpack styles are no longer injected in the Flag by default.
This change was made for two reasons:
- Server side support (the injecting relied on document)
- Not all users require the default styling so this caused unnecessary addition to bundle size
The new way of loading the CSS is by importing the default styles. You can do this in one of two ways.
// Component.tsx - In a component where flagpack is used
import 'react-flagpack/dist/style.css'
Or
/* Global.css - Importing it in the global css file */
@import 'react-flagpack/dist/style.css';