react-uwp icon indicating copy to clipboard operation
react-uwp copied to clipboard

Uncaught TypeError: Cannot convert undefined or null to object - When trying to change theme using local state(Toggling between 'dark' and 'light' ).

Open sachinpardeshi01 opened this issue 6 years ago • 0 comments

Uncaught TypeError: Cannot convert undefined or null to object When trying to change theme using local state(Toggling between 'dark' and 'light' ) gives error and UI breaks when loading page with new theme.

To Reproduce Steps to reproduce the behavior:

  1. Create dropdown to choose between themes (values ['dark', 'light'])
  2. Add onchange handler which will toggle value between dark and light.
  3. pass this theme string in state to getTheme [ Imported from 'react-uwp/Theme'] to change theme dyanamically.
  4. On dropdown change this error fired.

Expected behavior It should allow to change theme dyanamically.

Additional context Toggle state between 'dark' and 'light' and passing it to getTheme for react-uwp/theme causes error breaking the UI.

sachinpardeshi01 avatar Jul 19 '19 10:07 sachinpardeshi01