ITADN

Unable to derive `Patch` for `Store`

#4616Openmskorkowski 创建于 2026-03-04
M
mskorkowskicommented
**Describe the bug** Recently I've been updating my project dependencies to the new version of reactive stores. I found that derive code for Patch uses a private method `KeyMap::with_field_keys` which leads to broken code when using `store` attribute. **Leptos Dependencies** ```toml reactive_stores = { version = "0.4" } ``` **To Reproduce** Derive a `Patch` trait for a struct for a field which uses `#[store()]` attribute. ```rust /// State of the test execution #[derive(Debug, Clone, Copy, PartialEq, Eq, Store, Patch)] struct TestState { /// id of the test test_id: usize, } /// Model describing a state of the test view #[derive(Debug, Store, Patch)] struct TestViewModel { /// state of the test run #[store(key: usize = |state| state.test_id)] step_results: Vec<TestState>, } ``` **Next Steps** - [x] I will make a PR - [ ] I would like to make a PR, but need help getting started - [ ] I want someone else to take the time to fix this - [ ] This is a low priority for me and is just shared for your information
1 条评论