trackUnnecessaryRenders is reported as unknown option
Using react-scan 0.2.8, when calling scan() as follows:
useEffect(() => {
scan({
enabled: process.env.NODE_ENV === "development",
trackUnnecessaryRenders: true,
});
}, []);
the option is reported as unknown in the console because it is currently commented out in validateOptions:
https://github.com/aidenybai/react-scan/blob/164ba1cdde38b7c01dd38700dcb1fa0f8aeef16a/packages/scan/src/core/index.ts#L410-L413
despite being listed in the Options interface:
https://github.com/aidenybai/react-scan/blob/164ba1cdde38b7c01dd38700dcb1fa0f8aeef16a/packages/scan/src/core/index.ts#L168-L176
This is a mistake and is a deprecated API that was accidentally not fully removed. We may add this back, will have to think a little about it.
What this used to do was make outlines gray when the render didn't affect the DOM- which we consider "unnecessary" (which is not 100% true...). This was really hard to convey meaning and added overhead, so we deemed it wasn't worth keeping.
But, we may find a good opportunity to use it with notifications