Skip to content

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

@sachinpardeshi01

Description

@sachinpardeshi01

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions