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

adding fields to the underlying component function #637

Open
joprice opened this issue Dec 12, 2024 · 0 comments
Open

adding fields to the underlying component function #637

joprice opened this issue Dec 12, 2024 · 0 comments

Comments

@joprice
Copy link

joprice commented Dec 12, 2024

I'm trying to use the library https://github.com/welldone-software/why-did-you-render to log the reason for a component re-rendered. In order to get a functional component to be eligible for rendering, a boolean needs to be set on the function. When trying to do this from fsharp:

Components.SomeComponent?whyDidYouRender <- true

The function gets wrapped in the compiler plugin jsx transformation:

(() => createElement(Components_SomeComponent, null)).whyDidYouRender = true;

Is there any way to skip the transformation for cases like this, or do I need to use a modified version of the compiler plugin?

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

No branches or pull requests

1 participant