use `MultiProvider` with arbitrary props and not only `value: T`
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu bằng cách đọc các entry point MultiProvider và createContextProvider cùng với các định nghĩa prop TypeScript của chúng. Kiểm tra cách MultiProvider truyền giá trị hiện tại của từng context, sau đó xác minh rằng các context được tạo với các prop tùy ý như { initial: 1 } có thể được cung cấp mà không cần bọc chúng trong { value: ... }.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe The Problem To Be Solved
The Context primitive adds functionality to easily create context providers through createContextProvider. Given the example code on the website, ...
const [CounterProvider, useCounter] = createContextProvider((props: { initial: number }) => {
const [count, setCount] = createSignal(props.initial);
const increment = () => setCount(count() + 1);
return { count, increment };
});
// Provide the context
<CounterProvider initial={1}>
<App />
</CounterProvider>;
... the following code does not work when paired with the MultiProvider as it only accepts a single argument value:
<MultiProvider
values={[
[CounterProvider, { initial: 1 }] // not working, as this is passed to the single `value` field.
]}
>
<App />
</MultiProvider>;
Suggest A Solution
It would be nice if the individual contexts of MultiProvider accepted the same props as returned from createContextProvider so they seamlessly work together. A workaround would be to wrap the context props with { value: ContextProps }, but this destroys usability and requires refactoring the entire codebase
- Ngôn ngữ chính
- TypeScript
- Star
- 1.6k
- Fork
- 162
- Merge trung bình
- 1 giờ 20 phút
- Pull request đã merge (30 ngày)
- 7
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs-community/solid-primitives
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
solidjs-community/solid-primitives#1059 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
solidjs-community/solid-primitives#1060 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
solidjs-community/solid-primitives#1055 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
solidjs-community/solid-primitives#1000 · 3 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
solidjs-community/solid-primitives#894 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs-community/solid-primitives
Issue tương tự
-
priority: P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
prime-radiant-inc/evener#3291 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accessibility bug revealjs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
quarto-dev/quarto-cli#14961 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
supabase/agent-skills#614 ·
-
Content
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
RunestoneInteractive/rs#1559 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày