From 6ef25494ac6bd73957e2a3e433829698b5afa11c Mon Sep 17 00:00:00 2001 From: Gauthier Segay Date: Mon, 25 Mar 2024 00:24:19 +0100 Subject: [PATCH] Update StatefulComponents.md minor typo --- public/Feliz/React/StatefulComponents.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/Feliz/React/StatefulComponents.md b/public/Feliz/React/StatefulComponents.md index b7f0b829..76a951b3 100644 --- a/public/Feliz/React/StatefulComponents.md +++ b/public/Feliz/React/StatefulComponents.md @@ -1,6 +1,6 @@ # Stateful Components -Components can tremendously useful when they manage their internal state. This allows for some pieces of the UI to have stateful bevavior without polluting the global Elmish state. For example when you have an accordion component, whether it is collapsed or expanded is a piece of information that might not be relevant to your Elmish models so you keep that information internal to that specific component. Otherwise, if you are "going Elmish all the way", you would to keep track of which accordion is now in it's open state and have messages that are resposible for expanding and collapsing a specific accordion. +Components can be tremendously useful when they manage their internal state. This allows for some pieces of the UI to have stateful bevavior without polluting the global Elmish state. For example when you have an accordion component, whether it is collapsed or expanded is a piece of information that might not be relevant to your Elmish models so you keep that information internal to that specific component. Otherwise, if you are "going Elmish all the way", you would need to keep track of which accordion is now in it's open state and have messages that are resposible for expanding and collapsing a specific accordion. State with React components is incorporated using [React Hooks](https://reactjs.org/docs/hooks-intro.html) which allow you to define state variables inside your functional components. A common hook to use with React is the `React.useState` hook.