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

Correct function but incorrect explanation #3

Open
drecali opened this issue Jul 18, 2022 · 1 comment
Open

Correct function but incorrect explanation #3

drecali opened this issue Jul 18, 2022 · 1 comment

Comments

@drecali
Copy link

drecali commented Jul 18, 2022

Thank you for making such a useful tool. Your visual explanation is the best one I've seen so far!

I found an edge case where the explanation does not work well. The RegEx matches correctly and the substitution also works well. Only the visual explanation is affected.

Given this RegEx: /(?<!=\s)useSelector\(/

And this string to test:

const isSidebarOpen = useSelector((state: RootState) => state.ui.sidebarOpen);

// ✅ DO (create the isSidebarOpenSelector in the proper file, then import it here)
const isSidebarOpen = useSelector(isSidebarOpenSelector);

const backdropAlpha = (100 - useSelector(getBackdropBrightnessSelector)) / 100;

The explanation does not render if there is a < character in the RegEx. If I delete <, it renders, but after I add it back, nothing happens.

image

@cyrilbois
Copy link
Owner

Thanks for the feedback. I take note for the problem.

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

2 participants