Skip to content

An experiment to render a menu with React stored in a tree-like data structure

Notifications You must be signed in to change notification settings

NathanKleekamp/Render-Menu-from-Tree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

$ docker-compose up

Visit http://localhost:3000

What we're building

This thought experiment uses a tree-like data structure to store the data for the menu. It then walks the tree and selects the React component to correctly render the content based on a node's type.

screenshot of generated menu

Most interesting files

Other thoughts

By moving the onClick handlers to another file and referencing them only by name (as a string), it would be easier to write tests. Also, that would mean that the entire tree could be serialized as JSON. That could be handy, for example, if there was a toggle to change the keyboard shortcuts to accommodate different OSs, for example.

About

An experiment to render a menu with React stored in a tree-like data structure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published