Signal update not causing re-render
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, typescript
- Lĩnh vực
- build-system, frontend
Hướng nghiên cứu
Bắt đầu với hàm App và cách hàm này sử dụng createSignal, onMount và Show, sau đó kiểm tra các thiết lập được đề cập trong .babelrc, parcel.config.js và tsconfig. Tái tạo ví dụ tối giản và so sánh tích hợp Solid với ứng dụng đang hoạt động được liên kết; hoàn tất khi xác định được lý do thay đổi signal không cập nhật nhánh được render.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
This may be a me problem, but I am confused and imagine this is well above my understanding. I'm having trouble with a simple re-render when an onMount function changes a signal from false to true--in this case, used to signify that loading has finished. I have tinkered with a few things trying to get this app to work. It's a template using Colyseus + Phaser for a multiplayer server. I've added Solid JS to the front-end as per a previous, functioning app, and that's where all the trouble began!
This template is using parcel to bundle, and I've tried to maintain that, but it has been tricky integrating Solid. I've had to create
.babelrc file,
parcel.config.js file,
and update the tsconfig to
"jsx": "preserve",
"jsxImportSource": "solid-js/h" (in order to get it to stop screaming at me about a jsx-dev-runtime error)
In doing so, I've finally been able to get it to accept using Solid js, but now it's simply not rendering a signal change in the return's body.
Your Example Website or App
Steps to Reproduce the Bug or Issue
export default function App() {
const [menu, setMenu] = createSignal<boolean>(false);
onMount(() => {
console.log(menu(), 'Current Menu');
setMenu(true);
console.log(menu(), 'Current Menu');
});
return (
<div id="app">
<Show when={menu()} fallback={<Puff color="gold"/>}>
<div class='superCenter'>
<div>The Ascean</div>
<button>Enter Game</button>
</div>
</Show>
</div>
);
};
This is the smallest version of getting at what I'm talking about, it's simply not updating its render of the signal and reflecting that in the return.
the app above shows how it functions when it does work (this is a front-end only, single player version of the same concept I'm redesigning to incorporate a server for multiplayer)
Expected behavior
I expected it to update the rendering, but instead it remains stuck with it seeing the fallback of the Show component, a Puff from solid-spinner
Screenshots or Videos
https://github.com/user-attachments/assets/23b0900f-fdfc-4631-b6fb-70ab219a7558
Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
Additional context
Apologies if this is a known issue, I've been trying to get this to work for a couple days now and after running into multiple, fixable errors, this seems like one that's just above my head.
- Ngôn ngữ chính
- MDX
- Star
- 292
- Fork
- 361
- Merge trung bình
- 7 giờ 51 phút
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
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/solid-docs
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
solidjs/solid-docs#1635 ·
-
[Content]: Cloudflare Workers Đang mởgood first issue solid solidstart
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
solidjs/solid-docs#1522 ·
-
pending review
solidjs/solid-docs#1637 · 1 người được giao ·
-
help wanted
solidjs/solid-docs#1636 · 5 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
solidjs/solid-docs#1630 · 1 bình luận ·
Tất cả issue của solidjs/solid-docs
Issue tương tự
-
status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
conda-forge/spacy-feedstock#177 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
area:jail bug security severity:low track:open-source
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
micro-ROS/micro_ros_setup#837 ·