myxvisual / react-uwp

📱⌨ React Components that Implement Microsoft's UWP Design & Fluent Design.
https://react-uwp.com
MIT License
1.18k stars 78 forks source link

It seems that there are some little bugs about theme. #123

Closed ScSofts closed 1 year ago

ScSofts commented 3 years ago

Problem description

I created a project the day before yestarday,and I follow this instruction to make a "card".But when the theme changed , the background of the "card" was still unchanged.

Minimal working code that reproduces the issue

import {themeContext} from "../utils/themeContext";
import React,{ useContext } from "react";

const ControlPage = ()=>{
    const theme = useContext(themeContext);
    const card = theme.prefixStyle({
              display: "flex",
              flexDirection: "row",
              alignItems: "center"
        });
        return (
                  <>
                        <div style={card}>
                              test!
                        </div>
                  </>
         );
};

export {ControlPage};

And I used setInterval to change the backgroundImage using theme.updateTheme. And the all the React-UWP component's background is changed,but the div stayed unchanged.

Versions