Shmew / Stateful-Menu

Using a stateful React function component in a SAFE app to toggle a side-menu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stateful Menu

This example shows how you can store state in a React function component, allowing you to manage certain UI concerns outside of the main Elmish application model.

It is just the out-of-the box SAFE Todo app with a push menu added. This menu uses the React.useState hook to store a bool which tracks whether it is open or closed.

For more advanced scenarios consider the `React.useElmish' hook provided by Feliz to give the component its own separate MVU loop.

It was created to accompany a blog on our website, check it out!

About

Using a stateful React function component in a SAFE app to toggle a side-menu


Languages

Language:JavaScript 50.2%Language:F# 47.4%Language:HTML 2.4%