Skip to content

Commit

Permalink
Replace Object.assign with spread
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtekmaj committed Apr 26, 2024
1 parent 5929af4 commit 78ea1f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/diagramElements/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default function Section(props: SectionProps) {
// If we're creating a section containing subsections, we don't need to create one.
if (children.find((el) => el.type === Subsection)) {
return Children.map(children, (child) =>
cloneElement(child, Object.assign({ sectionCol: col }, props, child.props)),
cloneElement(child, { sectionCol: col, ...props, ...child.props }),
);
}

Expand Down

0 comments on commit 78ea1f4

Please sign in to comment.