Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1834 link component is not checking if href is undefined #1856

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Our versioning strategy is as follows:
* `[sitecore-jss]` `[sitecore-jss-react]` DateField empty value is not treated as empty ([#1836](https://github.com/Sitecore/jss/pull/1836))
* `[templates/nextjs-sxa]` Fix styles of title component in metadata mode. ([#1839](https://github.com/Sitecore/jss/pull/1839))
* `[templates/nextjs-sxa]` Fix missing value of field property in Title component. ([#1842](https://github.com/Sitecore/jss/pull/1842))
* `[packages/sitecore-jss-react/src/components/Link.tsx]` Fix link component is not checking if href is undefined. ([#1856](https://github.com/Sitecore/jss/pull/1856))


### 🎉 New Features & Improvements
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss-react/src/components/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const Link: React.FC<LinkProps> = withFieldMetadata<LinkProps, HTMLAnchor
const querystring = link.querystring ? `?${link.querystring}` : '';

const anchorAttrs: { [attr: string]: unknown } = {
href: `${link.href}${querystring}${anchor}`,
href: link.href ? `${link.href}${querystring}${anchor}` : undefined,
className: link.class,
title: link.title,
target: link.target,
Expand Down