Skip to content

feat: add a test case for the function props not recalculating - #39

Merged
ThiefMaster merged 2 commits into
indico:masterfrom
OliverGeneser:fix-prop-recalc
Sep 14, 2026
Merged

ThiefMaster merged 2 commits into
indico:masterfrom
OliverGeneser:fix-prop-recalc

Conversation

@OliverGeneser

Copy link
Copy Markdown
Contributor

No description provided.

@palkerecsenyi

palkerecsenyi commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

I've added a fix for the bug and the tests are passing now.

This code meant that extraProps was completely overwritten if it was a function, so future changes to the props didn't cause the function to be recomputed. This PR now fixes that.

export function parametrize(Component, extraProps) {
  const ParametrizedComponent = props => {
    // handle deferred prop calculation
    if (typeof extraProps === 'function') {
      extraProps = extraProps(props);
    }

@OliverGeneser
OliverGeneser marked this pull request as ready for review September 3, 2026 12:18
@ThiefMaster
ThiefMaster merged commit d431761 into indico:master Sep 14, 2026
1 check passed
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