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

Keep getting exception 'document is not defined' #102

Open nitinsap opened 4 years ago

nitinsap commented 4 years ago

Problem description

I am trying to create Windows UWP application using react-uwp.

These are the steps I follow to create react native windows app - https://microsoft.github.io/react-native-windows/docs/getting-started#running-a-react-native-windows-app

After that I am editing App.js to include Theme from react-uwp. This is my code -

` import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View } from 'react-native'; import CheckBox from "react-uwp/CheckBox"; import { Theme as UWPThemeProvider, getTheme } from "react-uwp/Theme"; import aaa from './style.js'

const instructions = 'Press Ctrl+R to reload,\n' + 'Shift+F10 or shake for dev menu';

const theme = getTheme({ themeName: "dark", accent: "#0078D7", useFluentDesign: true, userAgent: req.headers['all'] });

export default class App extends Component<{}> { render() { return ( <UWPThemeProvider theme={theme} needGenerateAcrylic={false} // if using SSR, set this config to false, using fallback color.

); } }

ReactDOM.render( , document.getElementById("app") ); `

When I run this, I get exception - 'document' is not defined. Exception is coming at backdropFilterDetector.js

Link to minimal working code that reproduces the issue

Versions