Skip to content
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

docs: Add example for how to use react hooks to get the context #165

Closed
wants to merge 1 commit into from

Conversation

raphaeleidus
Copy link

@raphaeleidus raphaeleidus commented May 24, 2022

There are examples for getting the client from the context with the withOptimizely HOC but there isn't an example on how to use react hooks to do the same thing.

@mikechu-optimizely
Copy link
Contributor

Hi @raphaeleidus

I'm working through the backlog of GitHub Issues and PRs. Thanks for hanging in there with us.

Please sign the Contributor License Agreement (CLA) outlined in CONTRIBUTING when you get a second.

Thanks.

@mikechu-optimizely
Copy link
Contributor

@egucciar Thanks for the review 😄

@raphaeleidus
Copy link
Author

@mikechu-optimizely done

@mikechu-optimizely
Copy link
Contributor

I'm rolling this into #210 (which I dislike having become a hodgepodge of commits) I need to end the madness shortly here.

mikechu-optimizely added a commit that referenced this pull request Sep 22, 2023
* Remove devcontainer comments

* Testing bug bash devcontainer config

* Remove the separate dev container conf

* Add setup & exec as npm scripts

* Use LF by default when in devcontainer

* Update jest config

* Update JS SDK via yarn.lock

* Convert to TS for bug bash

* Prompt for SDK key for the bug bash

* Ignore the .env file

* Enhance setup.sh

* Conditionally npm

* Change back to scripty .js

* Add boilerplate React bug-bash/app

* Update setup.sh to install + run React app

* Update npm script to run bug-bash

* Simplify setup.sh

* Simplify the react app

* WIP: Update App + use local @optimizely/react-sdk

* Add local React & dotenv

* Update setup script

* Remove dotenv

* WIP bring .env values in

* Complete WIP on reading SDK from .env

* Transfer @rafinutshaw-optimizely's work in

* Small style fix

* Minor semantic HTML changes

* A bunch'o NITs for my comfort

* Rename bug-bash setup & add run

* Ensure shell scripts use LF line endings

* WIP testing & refactoring tests

* Better doc & UI + Refactors

* Move Decision; Finish refactor existing tests

* Add more tests based on spreadsheet\

* Add sendOdpEvent tests

* Last bits of documentation

* Update to use js sdk 5.0.0-beta4

* WIP test updates

* Update path to logging

due to re-organized JS SDK

* Update bug bash to package-lock.json

* Add @types/uuid 🤔

* Use /lib/ instead of /dist/ from JS SDK

* Reset for other bashers

* Add more documentation

* Upgrade vulnerable tough-cookie to v4.1.3

* Add "repository" field to package.json

Thanks @iamstarkov

* Add `useContext` documentation from...

@raphaeleidus in #165

* Add EOF lines

* Remove React.StrictMode

* Remove Vite icon ref

* Add decision button to change userId

* Remove variationKey validation

* Upgrade to JS SDK 5.0.0-beta5

* Fix references to remove /lib

* WIP: Fixing getLogger ref from JS 5-beta5

* Explicitly optimizeDep-endcy JS SDK

* Export OptimizelySegmentOption from JS SDK

* Use OptimizelySegmentOption from React SDK export

* Update bug bash package-lock

* Remove optimizeDeps from viteconfig

* Add test comment

* Changed optimizelyClient init location in BB app

* Add VSCode launch.json

* Add conditional to auto fetchQualifiedSegments

* Format .vscode files

* Leave out tough-cookie dep

* Minor clean ups

* Update package-json

* PR review change

* Remove bug bash app

* Refinement of PR request

WIP Fix tests that fail if dataReadyPromise resolves success=false

* PR correction

* Remove VSC lauch.json since no bug-bash

---------

Co-authored-by: Mike Chu <mike.chu@optimizely.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants