Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-head-safe",
"version": "1.0.1",
"version": "1.0.2",
"description": "A lightweight React head manager for CSR apps. Safely manage document title, meta tags, Open Graph, and SEO metadata without duplicates. TypeScript support included.",
"author": "umsungjun",
"license": "MIT",
Expand Down
20 changes: 3 additions & 17 deletions src/ReactHeadSafe.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
import React, { useLayoutEffect } from 'react';

export interface ReactHeadSafeProps {
/** The page title that will be set in the document.title */
title?: string;
/** The meta description tag content for SEO */
description?: string;
/** The meta keywords tag content for SEO */
keywords?: string;
/** The Open Graph title (og:title) for social media sharing */
ogTitle?: string;
/** The Open Graph description (og:description) for social media sharing */
ogDescription?: string;
/** The Open Graph image URL (og:image) for social media sharing */
ogImage?: string;
}
import { FC, useLayoutEffect } from 'react';
import { type ReactHeadSafeProps } from './types';

/**
* @description
Expand All @@ -30,7 +16,7 @@ export interface ReactHeadSafeProps {
* ogImage="https://example.com/image.jpg"
* />
*/
export const ReactHeadSafe: React.FC<ReactHeadSafeProps> = ({
export const ReactHeadSafe: FC<ReactHeadSafeProps> = ({
title,
description,
keywords,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { ReactHeadSafe } from './ReactHeadSafe';
export type { ReactHeadSafeProps } from './ReactHeadSafe';
export type { ReactHeadSafeProps } from './types';
14 changes: 14 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface ReactHeadSafeProps {
/** The page title that will be set in the document.title */
title?: string;
/** The meta description tag content for SEO */
description?: string;
/** The meta keywords tag content for SEO */
keywords?: string;
/** The Open Graph title (og:title) for social media sharing */
ogTitle?: string;
/** The Open Graph description (og:description) for social media sharing */
ogDescription?: string;
/** The Open Graph image URL (og:image) for social media sharing */
ogImage?: string;
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"lib": ["ES2020", "DOM"],
"jsx": "react",
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
Expand Down