Skip to content

Commit

Permalink
fix: fix JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Aug 13, 2024
1 parent 36f5c9c commit 5d1187b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions vike-solid/hooks/useConfig/useConfig-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@ import type { ConfigFromHook } from "../../types/Config.js";
import { usePageContext } from "../usePageContext.js";
import { getPageContext } from "vike/getPageContext";

/**
* Set configurations inside React components and Vike hooks.
*
* https://vike.dev/useConfig
*/
function useConfig(): (config: ConfigFromHook) => void {
// Vike hook
let pageContext = getPageContext() as PageContext & PageContextInternal;
if (pageContext) return (config: ConfigFromHook) => setPageContextConfigFromHook(config, pageContext);

// React component
// Component
pageContext = usePageContext();
return (config: ConfigFromHook) => {
if (!("_headAlreadySet" in pageContext)) {
Expand Down
4 changes: 2 additions & 2 deletions vike-solid/hooks/useConfig/useConfig-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { objectKeys } from "../../utils/objectKeys.js";
import { includes } from "../../utils/includes.js";

/**
* Set configurations inside React components and Vike hooks.
* Set configurations inside components and Vike hooks.
*
* https://vike.dev/useConfig
*/
Expand All @@ -19,7 +19,7 @@ function useConfig(): (config: ConfigFromHook) => void {
let pageContext = getPageContext() as PageContext & PageContextInternal;
if (pageContext) return (config: ConfigFromHook) => setPageContextConfigFromHook(config, pageContext);

// React component
// Component
pageContext = usePageContext();
return (config: ConfigFromHook) => {
if (!pageContext._headAlreadySet) {
Expand Down

0 comments on commit 5d1187b

Please sign in to comment.