Skip to content

Commit 25b32e2

Browse files
committed
fix notifier not exposing ownerDataMap
1 parent f320386 commit 25b32e2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/getUpdateInfo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,6 @@ export default function getUpdateInfo({Component, displayName, hookName, prevOwn
6666
nextState,
6767
nextHookResult,
6868
reason: getUpdateReason(prevOwner, prevProps, prevState, prevHookResult, nextOwner, nextProps, nextState, nextHookResult),
69+
ownerDataMap: wdyrStore.ownerDataMap,
6970
};
7071
}

tests/getUpdateInfo.test.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ describe('getUpdateInfo', () => {
3434

3535
expect(updateInfo).toEqual({
3636
...input,
37+
ownerDataMap: expect.any(WeakMap),
3738
displayName: 'TestComponent',
3839
reason: {
3940
propsDifferences: [],
@@ -58,6 +59,7 @@ describe('getUpdateInfo', () => {
5859

5960
expect(updateInfo).toEqual({
6061
...input,
62+
ownerDataMap: expect.any(WeakMap),
6163
displayName: 'TestComponent',
6264
reason: {
6365
propsDifferences: [],
@@ -82,6 +84,7 @@ describe('getUpdateInfo', () => {
8284

8385
expect(updateInfo).toEqual({
8486
...input,
87+
ownerDataMap: expect.any(WeakMap),
8588
displayName: 'TestComponent',
8689
reason: {
8790
propsDifferences: [],
@@ -106,6 +109,7 @@ describe('getUpdateInfo', () => {
106109

107110
expect(updateInfo).toEqual({
108111
...input,
112+
ownerDataMap: expect.any(WeakMap),
109113
displayName: 'TestComponent',
110114
reason: {
111115
propsDifferences: [],
@@ -131,6 +135,7 @@ describe('getUpdateInfo', () => {
131135
expect(updateInfo).toEqual({
132136
...input,
133137
displayName: 'TestComponent',
138+
ownerDataMap: expect.any(WeakMap),
134139
reason: {
135140
propsDifferences: [
136141
{
@@ -162,6 +167,7 @@ describe('getUpdateInfo', () => {
162167
expect(updateInfo).toEqual({
163168
...input,
164169
displayName: 'TestComponent',
170+
ownerDataMap: expect.any(WeakMap),
165171
reason: {
166172
propsDifferences: [],
167173
stateDifferences: [
@@ -193,6 +199,7 @@ describe('getUpdateInfo', () => {
193199
expect(updateInfo).toEqual({
194200
...input,
195201
displayName: 'TestComponent',
202+
ownerDataMap: expect.any(WeakMap),
196203
reason: {
197204
propsDifferences: [
198205
{
@@ -231,6 +238,7 @@ describe('getUpdateInfo', () => {
231238
expect(updateInfo).toEqual({
232239
...input,
233240
displayName: 'TestComponent',
241+
ownerDataMap: expect.any(WeakMap),
234242
reason: {
235243
propsDifferences: [
236244
{
@@ -264,6 +272,7 @@ describe('getUpdateInfo', () => {
264272
expect(updateInfo).toEqual({
265273
...input,
266274
displayName: 'TestComponent',
275+
ownerDataMap: expect.any(WeakMap),
267276
reason: {
268277
propsDifferences: [],
269278
stateDifferences: [
@@ -297,6 +306,7 @@ describe('getUpdateInfo', () => {
297306
expect(updateInfo).toEqual({
298307
...input,
299308
displayName: 'TestComponent',
309+
ownerDataMap: expect.any(WeakMap),
300310
reason: {
301311
propsDifferences: [
302312
{
@@ -335,6 +345,7 @@ describe('getUpdateInfo', () => {
335345
expect(updateInfo).toEqual({
336346
...input,
337347
displayName: 'TestComponent',
348+
ownerDataMap: expect.any(WeakMap),
338349
reason: {
339350
propsDifferences: [
340351
{
@@ -366,6 +377,7 @@ describe('getUpdateInfo', () => {
366377
expect(updateInfo).toEqual({
367378
...input,
368379
displayName: 'TestComponent',
380+
ownerDataMap: expect.any(WeakMap),
369381
reason: {
370382
propsDifferences: [],
371383
stateDifferences: [
@@ -397,6 +409,7 @@ describe('getUpdateInfo', () => {
397409
expect(updateInfo).toEqual({
398410
...input,
399411
displayName: 'TestComponent',
412+
ownerDataMap: expect.any(WeakMap),
400413
reason: {
401414
propsDifferences: [
402415
{
@@ -435,6 +448,7 @@ describe('getUpdateInfo', () => {
435448
expect(updateInfo).toEqual({
436449
...input,
437450
displayName: 'TestComponent',
451+
ownerDataMap: expect.any(WeakMap),
438452
reason: {
439453
propsDifferences: [
440454
{
@@ -489,6 +503,7 @@ describe('getUpdateInfo', () => {
489503

490504
expect(updateInfo).toEqual({
491505
...input,
506+
ownerDataMap: expect.any(WeakMap),
492507
displayName: 'TestComponent',
493508
reason: {
494509
propsDifferences: [

0 commit comments

Comments
 (0)