-
Notifications
You must be signed in to change notification settings - Fork 37
enhancement (<OptimizelyFeature>): Convert to functional component that uses useFeature hook #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
* limitations under the License. | ||
*/ | ||
import { useCallback, useContext, useEffect, useState } from 'react'; | ||
import * as optimizely from '@optimizely/optimizely-sdk'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should have caused a lint error below (using the variable name optimizely when its already declared in outer scope) @mjc1283 - Is the tsc compiler smart enough to figure out which usage is a type? The scopes make it work as expected but I thought the tsc linter would complain. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 to linting against this. In our example code we try to use |
||
import { UserAttributes } from '@optimizely/optimizely-sdk'; | ||
import { getLogger } from '@optimizely/js-sdk-logging'; | ||
|
||
import { setupAutoUpdateListeners } from './autoUpdate'; | ||
|
@@ -38,7 +38,7 @@ type UseFeatureOptions = { | |
|
||
type UseFeatureOverrides = { | ||
overrideUserId?: string; | ||
overrideAttributes?: optimizely.UserAttributes; | ||
overrideAttributes?: UserAttributes; | ||
}; | ||
|
||
interface UseFeature { | ||
|
Uh oh!
There was an error while loading. Please reload this page.