Signal update not causing re-render
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript, typescript
- Área
- build-system, frontend
Línea de trabajo
Empieza con la función App y su uso de createSignal, onMount y Show; después, revisa la configuración mencionada de .babelrc, parcel.config.js y tsconfig. Reproduce el ejemplo mínimo y compara la integración de Solid con la aplicación funcional enlazada; se considera terminado cuando se haya identificado por qué el cambio de la señal no actualiza la rama renderizada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- MDX
- Estrellas
- 292
- Forks
- 361
- Merge medio
- 7 h 51 min
- PR fusionados (30 d)
- 1
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de solidjs/solid-docs
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
solidjs/solid-docs#1635 ·
-
[Content]: Cloudflare Workers Abiertogood first issue solid solidstart
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
solidjs/solid-docs#1522 ·
-
pending review
solidjs/solid-docs#1637 · 1 asignado ·
-
help wanted
solidjs/solid-docs#1636 · 5 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
solidjs/solid-docs#1630 · 1 comentario ·
Todos los issues de solidjs/solid-docs
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
CS0162 "Unreachable code detected" warning from a MSBuildTemp .tmp file in every game project Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
area:engineering priority:p2 type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
jejjohnson/pyrox#234 ·
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
good first issue
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
ros2/ros2_tracing#266 · 1 comentario ·