Skip to content

Commit

Permalink
Merge branch 'main' into docs/keyboard-key-init
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Nov 27, 2024
2 parents 4bed0a9 + 7f39856 commit 6030035
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .changeset/nervous-rabbits-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@twilio-paste/progress-steps": patch
"@twilio-paste/core": patch
---

[ProgressSteps] fixed an issue where progress steps was rerendering unnecessarily
7 changes: 7 additions & 0 deletions internal-docs/engineering/gotchas.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Gotchas

The purpose of this document is to keep a list of niche issues that have arisen over the lifetime of the product that we do not want to re-introduce. This can be related to our coded or third party libraries.

## Emotion Library

* If you pass a prop of the component into `styled.div` be sure to wrap it in useMemo as this librabry causes unnecessary re-renders otherwise.
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ const ItemSeparatorStyles: {

export const ProgressSteps = React.forwardRef<HTMLDivElement, ProgressStepsProps>(
({ element = "PROGRESS_STEPS", orientation = "horizontal", ...props }, ref) => {
const ContainerStyled = styled.div(
css({
display: "flex",
...ItemSeparatorStyles[orientation],
}),
const ContainerStyled = React.useMemo(
() =>
styled.div(
css({
display: "flex",
...ItemSeparatorStyles[orientation],
}),
),
[orientation],
);

return (
Expand Down

0 comments on commit 6030035

Please sign in to comment.