Skip to content

Conversation

@mbest
Copy link
Contributor

@mbest mbest commented Aug 26, 2025

This PR moves the observer definition for plain functional components before the definition for forwardRef component. Without this change, the code below will generate a TypeScript error

    const TestComponent: React.FC<IProps> = observer(
        validateChildrenWrapper(function TestComponent({ value }) {
            return <div>{value}</div>
        })
    )

Error: Property 'value' does not exist on type '{}'

Before:
image

After:
image

@changeset-bot
Copy link

changeset-bot bot commented Aug 26, 2025

⚠️ No Changeset found

Latest commit: ca86c59

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link
Member

@mweststrate mweststrate left a comment

Choose a reason for hiding this comment

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

Nice catch, thanks!

@mweststrate mweststrate merged commit 76cad6f into mobxjs:main Sep 26, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Sep 26, 2025
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.

2 participants