Skip to content

Conversation

@umsungjun
Copy link
Owner

@umsungjun umsungjun commented Jan 22, 2026

  • Define ReactHeadSafeProps in src/types.ts with JSDoc comments
  • Update ReactHeadSafe to use the new type
  • Export ReactHeadSafeProps from index.ts for external use
  • Configure TypeScript to emit declaration files for consumers

Summary by CodeRabbit

  • New Features

    • Component now actively manages document title and meta tags (description, keywords, Open Graph) on the client.
  • Bug Fixes

    • Prevents duplicate meta tags by removing existing ones before adding updates.
  • Refactor

    • Moved public prop type definitions into a shared types module for clearer structure.
  • Chores

    • Build tooling updated to emit declaration maps; package version bumped.

✏️ Tip: You can customize this high-level summary in your review settings.

- Define ReactHeadSafeProps in src/types.ts with JSDoc comments
- Update ReactHeadSafe to use the new type
- Export ReactHeadSafeProps from index.ts for external use
- Configure TypeScript to emit declaration files for consumers
@vercel
Copy link

vercel bot commented Jan 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
react-head-safe Ready Ready Preview, Comment Jan 22, 2026 4:31am

@coderabbitai
Copy link

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

Moved the public props interface to a new types.ts, updated exports/imports, implemented client-side head updates in ReactHeadSafe.tsx using useLayoutEffect and an updateMetaTag helper, enabled declarationMap in TypeScript, and bumped package version.

Changes

Cohort / File(s) Summary
Type definitions
src/types.ts, src/index.ts, src/ReactHeadSafe.tsx
Added ReactHeadSafeProps to src/types.ts; updated src/index.ts to export the type from ./types; changed ReactHeadSafe.tsx to import the type and use FC<ReactHeadSafeProps> instead of declaring the interface inline.
Client-side head management
src/ReactHeadSafe.tsx
Replaced render output with side-effect-only component: uses useLayoutEffect to set document.title and update meta tags (description, keywords, og:title, og:description, og:image); added updateMetaTag helper to remove existing tags and attach new ones; component returns null.
TypeScript build config
tsconfig.json
Enabled declarationMap: true in compilerOptions.
Package metadata
package.json
Bumped package version from 1.0.1 to 1.0.2.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I hopped through types and tidied the nest,
Meta flowers placed where they fit best,
Titles set gently with a careful paw,
Maps for declarations, neat and law,
A tiny rabbit cheers this code refresh 🌷

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: exporting the ReactHeadSafeProps type definitions from a new src/types.ts file and updating references throughout the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@umsungjun umsungjun merged commit b229929 into main Jan 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants