Skip to content

Commit ad1c5b1

Browse files
Update README.md
update reference to `dispose` function
1 parent d296e7b commit ad1c5b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ In the sections below, we will review each of the steps in more detail:
3636
In your app, you can setup the SPConsent manager in a external file or on your app. In the example below we use `useRef`
3737
to keep a reference of the `SPConsentManager`.
3838

39-
> It is important to notice that we wrap the initialisation of `SPConsentManager` in a `useEffect` and call `consentManager.current?.dispose()` to avoid memory leaks.
39+
> It is important to notice that we wrap the initialisation of `SPConsentManager` in a `useEffect` and set its reference to `null` to avoid memory leaks.
4040
4141
```ts
4242
const consentManager = useRef<SPConsentManager | null>();
@@ -52,7 +52,7 @@ useEffect(() => {
5252
);
5353

5454
return () => {
55-
consentManager.current?.dispose();
55+
consentManager.current = null;
5656
};
5757
}
5858
```

0 commit comments

Comments
 (0)