react-uwp
react-uwp copied to clipboard
backgroundimage not working
Problem description
When I set background image it shows: "TypeError: Cannot convert undefined or null to object"
return <UWPThemeProvider
theme={getTheme({
themeName: "light", // set custom theme
accent: "#0078D7", // set accent color
useFluentDesign: true, // sure you want use new fluent design.
desktopBackgroundImage: "http://127.0.0.1:3000/static/images/bg1.jpg" // set global desktop background image
})}
>
Here is whole error message:
TypeError: Cannot convert undefined or null to object
Theme._this.sureNeedGenerateAcrylic
node_modules/react-uwp/Theme/index.js:197
194 | if (needGenerateAcrylic &&
195 | newTheme.desktopBackgroundImage === currTheme.desktopBackgroundImage) {
196 | if (currTheme.useFluentDesign) {
> 197 | Object.assign(currTheme.isDarkTheme ? _this.cacheDarkAcrylicTextures : _this.cacheLightAcrylicTextures, {
198 | acrylicTexture40: currTheme.acrylicTexture40,
199 | acrylicTexture60: currTheme.acrylicTexture60,
200 | acrylicTexture80: currTheme.acrylicTexture80
View compiled
Theme../node_modules/react-uwp/Theme/index.js.Theme.componentWillReceiveProps
node_modules/react-uwp/Theme/index.js:294
291 | var _this = this;
292 | var theme = nextProps.theme;
293 | var currTheme = this.state.currTheme;
> 294 | var needGenerateAcrylic = this.sureNeedGenerateAcrylic(theme);
295 | if (nextProps && nextProps.theme && !this.props.autoSaveTheme) {
296 | if (theme.accent !== currTheme.accent ||
297 | theme.themeName !== currTheme.themeName ||
View compiled
callComponentWillReceiveProps
node_modules/react-dom/cjs/react-dom.development.js:6389
6386 | function callComponentWillReceiveProps(workInProgress, instance, newProps, newContext) {
6387 | startPhaseTimer(workInProgress, 'componentWillReceiveProps');
6388 | var oldState = instance.state;
> 6389 | instance.componentWillReceiveProps(newProps, newContext);
6390 | stopPhaseTimer();
6391 |
6392 | // Simulate an async bailout/interruption by invoking lifecycle twice.
View compiled
Link to minimal working code that reproduces the issue
Versions
- React-UWP: 1.1.8
- React: 16.2.0
- Browser: