Skip to content

Commit eeb5fe8

Browse files
rc
1 parent 3b45ba9 commit eeb5fe8

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

CHANGES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
2.1.1 (April 8, 2025)
2-
- Bugfix - Fixed `useSplitClient` and `useSplitTreatments` hooks to properly respect `updateOn<Event>` options. Previously, if the hooks were re-called due to a component re-render, they used the latest version of the SDK client status ignoring when `updateOn<Event>` options were set to `false` and resulting in unexpected changes in treatment values.
2+
- Bugfixing - Fixed `useSplitClient` and `useSplitTreatments` hooks to properly respect `updateOn<Event>` options. Previously, if the hooks were re-called due to a component re-render, they used the latest version of the SDK client status ignoring when `updateOn<Event>` options were set to `false` and resulting in unexpected changes in treatment values.
33

44
2.1.0 (March 28, 2025)
55
- Added a new optional `properties` argument to the options object of the `useSplitTreatments` hook, allowing to pass a map of properties to append to the generated impressions sent to Split backend. Read more in our docs.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-react",
3-
"version": "2.1.1",
3+
"version": "2.1.1-rc.1",
44
"description": "A React library to easily integrate and use Split JS SDK",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",

src/__tests__/useSplitClient.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,15 @@ describe('useSplitClient', () => {
261261
act(() => mainClient.__emitter__.emit(Event.SDK_UPDATE)); // do not trigger re-render because updateOnSdkUpdate is false
262262
expect(rendersCount).toBe(5);
263263

264-
wrapper.rerender(<Component updateOnSdkUpdate={false} updateOnSdkTimedout={false} />); // trigger re-render but should not update the status (SDK_UPDATE event should be ignored)
264+
wrapper.rerender(<Component updateOnSdkUpdate={false} updateOnSdkTimedout={false} />); // should not update the status (SDK_UPDATE event should be ignored)
265265
expect(rendersCount).toBe(6);
266266
expect(currentStatus).toEqual(previousStatus);
267267

268-
wrapper.rerender(<Component updateOnSdkUpdate={null /** invalid type should default to `true` */} />); // trigger re-render because there was an SDK_UPDATE event
268+
wrapper.rerender(<Component updateOnSdkUpdate={null /** invalid type should default to `true` */} />); // trigger re-render and update the status because updateOnSdkUpdate is true and there was an SDK_UPDATE event
269269
expect(rendersCount).toBe(8);
270270
expect(currentStatus.lastUpdate).toBeGreaterThan(previousStatus.lastUpdate);
271271

272-
act(() => mainClient.__emitter__.emit(Event.SDK_UPDATE)); // trigger re-render because updateOnSdkUpdate is true now
272+
act(() => mainClient.__emitter__.emit(Event.SDK_UPDATE)); // trigger re-render because updateOnSdkUpdate is true
273273
expect(rendersCount).toBe(9);
274274
expect(currentStatus.lastUpdate).toBeGreaterThan(previousStatus.lastUpdate);
275275

0 commit comments

Comments
 (0)