You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
enhancement (<OptimizelyFeature>): Convert to functional component that uses useFeature hook (#32)
Summary
Updates <OptimizelyFeature> to be a functional component that
Also adds support for userId and userAttribute overrides.
Addresses #30
Release
Is this a breaking change? In theory the logic should behave the same, as #28 was designed to implement the same logic as <OptimizelyFeature>.
Timing wise, when isServerSide is false, the state setting of the correct values of the feature/variables in useFeature happens in a second chained thennable, rather than the first.
I dont think this should be considered a breaking change (and thus warrant a major release), but I wanted to point it out.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -7,17 +7,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
8
8
## [Unreleased]
9
9
10
+
- Refactored `<OptimizelyFeature>` to a functional component that uses the `useFeature` hook under the hood. See [#32](https://github.com/optimizely/react-sdk/pull/32) for more details.
11
+
10
12
### New Features
11
13
12
14
- Added `useFeature` hook
13
15
- Can be used to retrieve the status of a feature flag and its variables. See [#28](https://github.com/optimizely/react-sdk/pull/28) for more details.
14
16
15
17
### Enhancements
16
18
17
-
- Exposed the entire context object used by
19
+
- Exposed the entire context object used by `<OptimizelyProvider>`.
18
20
- Enables support for using APIs which require passing reference to a context object, like `useContext`. [#27](https://github.com/optimizely/react-sdk/pull/27) for more details.
0 commit comments