Skip to content

fix(elements): Types for step component - #3359

Merged
brkalow merged 5 commits into
mainfrom
elements/fix-props-types
May 10, 2024
Merged

fix(elements): Types for step component#3359
brkalow merged 5 commits into
mainfrom
elements/fix-props-types

Conversation

@LekoArts

@LekoArts LekoArts commented May 10, 2024

Copy link
Copy Markdown
Contributor

Description

While writing the E2E tests I noticed a bug:
I couldn't apply className to SignIn.Step name="choose-strategy" and SignIn.Step name="forgot-password". Looking at the types, yeah, they only accepted children. They both didn't render any markup and were only Context wrappers.

This PR adds <div> as markup around these two steps and let's one apply their props to that.

While running the build process I got warnings about circular deps for Elements so I removed the barrel file for the sign-in step component and moved files around.

Checklist

  • npm test runs as expected.
  • npm run build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@changeset-bot

changeset-bot Bot commented May 10, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a25f2eb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/elements Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

import { createContextFromActorRef } from '~/react/utils/create-context-from-actor-ref';

export type SignInVerificationsProps = { preferred?: ClerkSignInStrategy; children: React.ReactNode } & FormProps;
export type SignInVerificationsProps = { preferred?: ClerkSignInStrategy } & FormProps;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

FormProps already marks children as required

@LekoArts
LekoArts marked this pull request as ready for review May 10, 2024 08:24

@panteliselef panteliselef left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice catch

@LekoArts
LekoArts marked this pull request as draft May 10, 2024 08:56
@LekoArts
LekoArts marked this pull request as ready for review May 10, 2024 13:59
@brkalow
brkalow merged commit 8cb4aa0 into main May 10, 2024
@brkalow
brkalow deleted the elements/fix-props-types branch May 10, 2024 17:57
@clerk-cookie clerk-cookie mentioned this pull request May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants