Skip to content

Commit

Permalink
fix: reactivity issue (#148)
Browse files Browse the repository at this point in the history
* fix: reactivity issue

* chore: update version to 1.0.1 in package.json for react cookie manager
  • Loading branch information
VmMad authored Oct 10, 2024
1 parent 51ec5da commit 95afebb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 91 deletions.
2 changes: 1 addition & 1 deletion cookie-manager/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@boxfish-studio/react-cookie-manager",
"version": "1.0.0",
"version": "1.0.1",
"author": "Boxfish Studio <[email protected]>",
"license": "Apache-2.0",
"repository": "github:boxfish-studio/cookie-manager",
Expand Down
4 changes: 2 additions & 2 deletions cookie-manager/react/src/lib/app/hooks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export function useManageServices(): {
configuredServices.value,
servicesInitialized.setValue
)
}, [necessaryCookies, configuredServices])
}, [configuredServices, servicesInitialized])

const stopServices = useCallback(() => {
stopCoreServices(
configuredServices.value,
removeUnnecessaryCookies,
servicesInitialized.setValue
)
}, [configuredServices, necessaryCookies])
}, [configuredServices, servicesInitialized, removeUnnecessaryCookies])

return { initializeServices: initServices, stopServices, removeUnnecessaryCookies }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function CookieManager({ configuration }: CookieManagerProps): React.JSX.
} else {
showCookieDisclaimer.setValue(true)
}
}, [necessaryCookies.value])
}, [necessaryCookies.value, initializeServices])

function handleSubmitNecessaryCookies(value: 'true' | 'false'): void {
setNecessaryCookies(
Expand Down
88 changes: 1 addition & 87 deletions demo/nextjs/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,95 +1,9 @@
import Image from 'next/image'
import styles from './page.module.css'

export default function Home(): React.JSX.Element {
return (
<div className={styles.page}>
<main className={styles.main}>
<Image
className={styles.logo}
src="https://nextjs.org/icons/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol>
<li>
Get started by editing <code>app/page.tsx</code>.
</li>
<li>Save and see your changes instantly.</li>
</ol>

<div className={styles.ctas}>
<a
className={styles.primary}
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className={styles.logo}
src="https://nextjs.org/icons/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
className={styles.secondary}
>
Read our docs
</a>
</div>
</main>
<footer className={styles.footer}>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/file.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="https://nextjs.org/icons/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org →
</a>
</footer>
<main className={styles.main}>NextJS Demo</main>
</div>
)
}

0 comments on commit 95afebb

Please sign in to comment.