Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Fix library export
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinguidee committed Nov 4, 2023
1 parent daeb21c commit 0c3b7d5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion lib/hooks/useNav.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { useContext, useEffect } from "react";
import { PageContext } from "../contexts/PageContext";

export const useNav = (path: string) => {
const useNav = (path: string) => {
const { setNavigation } = useContext(PageContext);

useEffect(() => {
setNavigation?.(path);
return () => setNavigation?.(undefined);
}, [path]);
};

export { useNav };
4 changes: 3 additions & 1 deletion lib/hooks/useTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { useContext, useEffect } from "react";
import { PageContext } from "../contexts/PageContext";

export const useTitle = (title: string) => {
const useTitle = (title: string) => {
const { setTitle } = useContext(PageContext);

useEffect(() => {
setTitle?.(title);
return () => setTitle?.(undefined);
}, [title]);
};

export { useTitle };
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ export default defineConfig({
react(),
dts({
insertTypesEntry: true,
exclude: ["**/*.stories.tsx", "**/*.test.tsx"],
rollupTypes: true,
exclude: ["**/*.test.tsx"],
}),
],
build: {
lib: {
entry: resolve(__dirname, "lib/index.ts"),
name: "vertex-components",
formats: ["es", "umd"],
fileName: (format) => `vertex-components.${format}.js`,
},
copyPublicDir: false,
Expand Down

0 comments on commit 0c3b7d5

Please sign in to comment.