Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

render double html markup or mounted app twice at initial rendering #7

Open
DilipCoder opened this issue Jul 20, 2018 · 0 comments
Open

Comments

@DilipCoder
Copy link

hello sir,
i am working on a project which is based upon this repo I have additional package unistore and i warap it into index.js

`let store = createStore(initialState)
if(typeof window !== "undefined"){
store = (window.STATE && window.STATE !== "==InitialState==") ? createStore(window.STATE) : createStore(initialState)
}
const App = ({url, Serverstore}) => {
let Finalstore = (Serverstore && typeof Serverstore !== "undefined") ? Serverstore : store
return(



)
}

export default App`

in my server.js I have added

let store = createStore(initialState) let state = store.getState() let body = render(h(App, { url: req.url, Serverstore: store }))

initial state on the server side and client side are same. when I run the application on development server it's run smoothly. but when I deploy it on the production server it's inserted client-side app below the SSR markup only on initial rendering when I reload the app double markup removed and run as expected. please help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant