Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Function Components & Hooks V2 #2401
Function Components & Hooks V2 #2401
Changes from 35 commits
c1ed876
863fa92
22d91f6
d940a7d
572becb
7dc8373
7e8bcdd
2664141
aac78b1
1e5c373
5f086e8
a87b2c7
62396f0
72518e2
38e06b1
19af0b3
49454cd
eb85f47
4f0260c
344ae10
ffca655
7b8978b
15585ff
3dbcdac
f07c648
7118b19
171e085
2f3856a
2b1d6f1
ac765cb
9c300ed
76da3f6
541a945
80dc7e2
347623b
e974dff
7160c18
aa2e803
1799102
acc87d1
00a653a
c861231
e82b4ec
935a672
806f618
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I take it that this design means I can't call any function starting with
use_
that is not a hook and false positives are a conscious trade-off? How do I turn this off when such a false positive occurs?I have some doubts that this kind of syntax guided rewriting is maintainable in the long term, do you know any bigger library that uses this approach successfully to convince me that it's not going to break on us in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used in std as well, which I will reply to the main comment instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@futursolo we should mention this in the error to be more user friendly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no way to do it. The procedural does not know the type of your expression.
The only error will be from the compiler saying that
use_something
does not implementHook
.