8000 refactor: update ButtonProps target type to include specific values by iamraihan · Pull Request #132 · getdokan/dokan-ui · GitHub
[go: up one dir, main page]

Skip to content

refactor: update ButtonProps target type to include specific values - #132

Merged
shams-sadek1981 merged 1 commit into
developfrom
enhance/button-target-props
Jan 29, 2026
Merged

shams-sadek1981 merged 1 commit into
developfrom
enhance/button-target-props

Conversation

@iamraihan
@iamraihan iamraihan commented Jan 29, 2026 •
Copy link
Copy Markdown
Contributor
  • Changed target prop type from string to a union of specific values: '_blank', '_self', '_parent', and '_top' for better type safety and clarity.

Summary by CodeRabbit

Release Notes

  • Refactor
    • Enhanced type safety for internal components.

Note: This release contains no end-user visible changes.

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

- Changed target prop type from string to a union of specific values: '_blank', '_self', '_parent', and '_top' for better type safety and clarity.
@coderabbitai
coderabbitai Bot commented Jan 29, 2026 •
Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The ButtonProps interface in src/components/Button.tsx is updated to restrict the target property from accepting any string value to only accepting valid HTML anchor target values: '_blank', '_self', '_parent', or '_top'.

Changes

Cohort / File(s) Summary
Button Component Type Safety
src/components/Button.tsx
Updated ButtonProps.target property from generic string type to a strict union type of valid HTML anchor target values ('_blank' | '_self' | '_parent' | '_top'), improving type safety without functional changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A button's target now shines so bright,
No more strings loose, just types held tight!
_blank, _self, _parent, _top in view,
Type safety hops—this change rings true! 🎯

🚥 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: updating the ButtonProps target type from a generic string to specific union values for improved type safety.
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.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@shams-sadek1981
shams-sadek1981 merged commit 58a48d5 into develop Jan 29, 2026
6 checks passed
Copilot AI left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR tightens the typing of the Button component’s target prop to improve type safety for link-style buttons. It limits target to the standard browser keyword values instead of an arbitrary string.

Changes:

  • Updated ButtonProps.target from string to a string-literal union: '_blank' | '_self' | '_parent' | '_top'.
  • Ensured the Button link rendering (<a>) uses this narrowed type without any further behavioral changes.

@iamraihan iamraihan self-assigned this Feb 3, 2026

This branch was successfully deployed

1 active deployment
Preview — 0273bd39 Deployed Jan 29, 2026 by vercel[bot]
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

0