Build failure for OnUpdateState with ComponentContext isn't useful
See original GitHub issue- [yes https://github.com/facebook/litho/issues?utf8=✓&q=is%3Aissue+is%3Aopen+state ] I have searched existing issues and this is not a duplicate
Version
0.15.0
Issues and Steps to Reproduce
Make a ComponentSpec with an @OnUpdateState
method and put ComponentContext
as the first argument. The build failure does not describe the reason the build fails. It doesn’t even point to the Component causing the issue.
The @OnUpdateState
method which broke the build was in VehicleSelectionComponentSpec
, which isn’t even mentioned in the build failure.
Expected Behavior
Build failure clearly indicates the problematic method.
Link to Code
@OnUpdateState
static void onUpdateVehicleList(
ComponentContext c,
StateValue<Set<Long>> vehicles,
@Param Set<Long> updatedVehicles) {
vehicles.set(updatedVehicles);
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Attempt to update state onClick results in "this.setState is not a ...
You're getting this error because the keyword this is not pointing to your component's execution context and it's current execution context ...
Read more >Basics | Litho
Transition is a description of which Component/Property (mandatory) and how (optional) you want to animate. You will not use a constructor to create...
Read more >Validate Compound Component Context Consumers
If someone uses one of our compound components outside the React.createContext `, they will experience a confusing error. We could provide a default...
Read more >State in Specs | Litho
This page introduces the concept of state in a component written using the Java Spec API, namely a @LayoutSpec or @MountSpec.
Read more >How to manage or eliminate React state without Redux
Export state management functions alongside components; Build more ... products whenever I make a change, because I have to update the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok will try to reproduce tonight and see if I can prepare a fix!
Checked and error message appears correct when building now, closing