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

fix: changed import style to fix missing api table #296

Merged
merged 3 commits into from
Jan 4, 2023

Conversation

wp-aberg
Copy link
Contributor

@wp-aberg wp-aberg commented Dec 22, 2022

What I did

This PR changes the import of React to make API tables work. This is a known issue in react-typescript-docgen styleguidist/react-docgen-typescript#323

WPDS-1293

@wp-aberg wp-aberg requested a review from a team as a code owner December 22, 2022 15:50
@wp-aberg wp-aberg requested review from artmsilva, atomictangerine and clairehhelms and removed request for a team December 22, 2022 15:50
@vercel
Copy link

vercel bot commented Dec 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
wpds-ui-kit ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Dec 22, 2022 at 4:31PM (UTC)
wpds-ui-kit-storybook ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Dec 22, 2022 at 4:31PM (UTC)

@@ -163,6 +162,7 @@ export const InputText = React.forwardRef<HTMLInputElement, InputTextProps>(
}, [ref, internalRef]);

useEffect(() => {
globalInputAutoFillTriggerAnimations();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not related to the API table, but this code was being called every render. Just once in the use effect is all that's strictly necessary.

@@ -179,7 +179,7 @@ export const InputText = React.forwardRef<HTMLInputElement, InputTextProps>(
return () => {
element?.removeEventListener("animationstart", onAnimationStart, false);
};
});
}, []);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding the empty array ensures that this only gets called once on the initial render.

@wp-aberg wp-aberg merged commit 0338e1a into main Jan 4, 2023
@wp-aberg wp-aberg deleted the input-text-api-table branch January 4, 2023 18:03
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