twlevelup / watch_edition_react

A smartwatch simulator, built in ReactJS
MIT License
3 stars 2 forks source link

Buttons do not rebind the new handlers on every screen #23

Closed aaron-m-edwards closed 7 years ago

aaron-m-edwards commented 7 years ago

Due to the way the button mapper handler works it does not rebind proper handlers when navigating to a page that either does not specify every button, or does not run the mapper method. This results in a situation where the buttons still preform the actions of previous screens on the new screen.

Steps to reproduce

GIVEN

I am on the Home Screen

WHEN

I Navigate to the Contacts screen (Left button)

AND

I press the right Button

THEN

I am taken to the Counter screen

EXPECTED (at least what I can gather by the intention of the code)

I will be taken to the "Oh Noes" screen

sinan-aumarah commented 7 years ago

I'll be doing the redux spike hopefully tonight and see if I can come up with a cleaner way for all the button mappings

aaron-m-edwards commented 7 years ago

Yeah that is cool, I will still fix this issue in the master branch. Basically I am planning bringing the router above one level, forcing the buttons to re-render on each page load rather than effectively mutating.

I am still really on the fence about redux, I think we are already biting off to much by introducing javascript/react/jsx etc I would rather not have to teach redux also. I would rather focus more on working as a team/tdd/etc

sinan-aumarah commented 7 years ago

@aaron-m-edwards can we close this now?