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

Examples Addition #4

Closed prateekrastogi closed 7 years ago

prateekrastogi commented 7 years ago

Hi, I was just trying to use the library with next.js. And, I think react-uwp integration with it is not as straightforward. The main problem lies in injecting application context managed by framework. As seen on this issue . Thus, I looked in to their example repo and found material ui project theme example , and I guess integration will be quite similar. But, I am currently working on different priority right now. Also, I think that developing an integration example with it and creating a pull request for addition in examples directory of next.js will create the further awarness for this project. Adding, an examples directory like that of next.js in react-uwp project for would be a nice idea. I have seen the docs directory having one, but the name sound slight un-intitutive to me. Don't you think 'examples' as root directory name and 'docs' as sub directory name would be a better option? At some place in doc antcores is mentioned, can you include its source code too as an example too?

myxvisual commented 7 years ago

sure, i will add examples to next.js, and publish antcores source code too, thanks for your advice~

myxvisual commented 7 years ago

@prateekrastogi Hi, here is next.js example with-react-uwp, i pull a requeset to next.js, hope that managers can quickly merge it. The AntCores project is here antcores.com, i will update it.

prateekrastogi commented 7 years ago

Thanks a lot. Will try to integrate in my workflow asap.

prateekrastogi commented 7 years ago

Hi, I am getting the following error when trying to load the page after running the server

TypeError: Cannot read property 'map' of undefined at Head.getPreloadDynamicChunks (C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\next\dist\server\document.js:146:20) at Head.render (C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\next\dist\server\document.js:174:14) at C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\react-dom\lib\ReactCompositeComponent.js:795:21 at measureLifeCyclePerf (C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\react-dom\lib\ReactCompositeComponent.js:75:12) at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\react-dom\lib\ReactCompositeComponent.js:794:25) at ReactCompositeComponentWrapper._renderValidatedComponent (C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\react-dom\lib\ReactCompositeComponent.js:821:32) at ReactCompositeComponentWrapper.performInitialMount (C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\react-dom\lib\ReactCompositeComponent.js:361:30) at ReactCompositeComponentWrapper.mountComponent (C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\react-dom\lib\ReactCompositeComponent.js:257:21) at Object.mountComponent (C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\react-dom\lib\ReactReconciler.js:45:35) at ReactDOMComponent.mountChildren (C:\Code\Starters\next.js\examples\with-react-uwp\node_modules\react-dom\lib\ReactMultiChild.js:236:44)

myxvisual commented 7 years ago

@prateekrastogi It‘s’ looks like this problem.

_document.js - TypeError: Cannot read property 'map' of undefined v3's getInitialProps is kind a different.

Here is right example.

prateekrastogi commented 7 years ago

Hi, Thanks a lot. Now, it's working properly. While going through the code, i got some questions about the example:

myxvisual commented 7 years ago

@prateekrastogi Sorry, recently a little busy. utf-8 charset is specifies the character encoding for the HTML document. theme-color is PWA primary color. viewport you can refer to the Using the viewport meta tag to control layout on mobile browsers. contextTypes Not necessarily, but use it, you can get the theme config under Theme

prateekrastogi commented 7 years ago

Hi, For context type, what do you mean by theme config under Theme?