Skip to content

Commit e796103

Browse files
fix(clerk-js): Check if legacy property has value before display warning (clerk#3254)
* fix(clerk-js): Check if legacy property has value before display warning * Create chilly-tips-smash.md * Update chilly-tips-smash.md --------- Co-authored-by: Nikos Douvlis <nikosdouvlis@gmail.com>
1 parent 6f3c11d commit e796103

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎.changeset/chilly-tips-smash.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clerk/clerk-js": patch
3+
---
4+
5+
Check if any legacy properties have value before displaying a warning

‎packages/clerk-js/src/utils/assertNoLegacyProp.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export function assertNoLegacyProp(props: Record<string, any>) {
22
const legacyProps = ['redirectUrl', 'afterSignInUrl', 'afterSignUpUrl', 'after_sign_in_url', 'after_sign_up_url'];
33
const legacyProp = Object.keys(props).find(key => legacyProps.includes(key));
44

5-
if (legacyProp) {
5+
if (legacyProp && props[legacyProp]) {
66
// TODO: @nikos update with the docs link
77
console.warn(
88
`Clerk: The prop "${legacyProp}" is deprecated and should be replaced with the new "fallbackRedirectUrl" or "forceRedirectUrl" props instead.`,

0 commit comments

Comments
 (0)