question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Raw Html Flash between route change

See original GitHub issue

React-static version 4.8.3 React version 16.0.0

The result is running the actual final build with npm run build. not npm start as it will load the dev environment loader.

Between transition of route, I experiencing this flash of raw html… What is the cause? Is there a solution? Any hint?

NOTE: I used the styled-component example as the base code, because all my styling is load through styled-components.

in the example, I switch from /about route to /contact route. and below shows what happened. abc

static-config.js

import axios from 'axios'
import {content} from 'content';
export default {
  getSiteProps: () => ({
    siteTitle: content.site.siteName.casual,
  }),
  siteRoot: 'http://site.com',
  getRoutes: async () => {
    return [
      {
        path: '/',
        component: 'src/containers/BlogListingPage',
      },
      {
        path: '/about',
        component: 'src/containers/AboutPage',
      },
      {
        path: '/contact',
        component: 'src/containers/ContactPage',
      },
      {
        path: '/blogs',
        component: 'src/containers/BlogPage',
        getProps: () => ({
          blogs: content.blogs,
        }),
        children: [
          {
            path: '/all',
            component: 'src/containers/BlogListingPage',
          },
          ...content.blogs.map(blog => ({
            path: `/detail/${blog.route.name}`,
            component: 'src/containers/BlogPage',
            getProps: () => ({
              blogRef: blog.route.name,
              blog: blog,
            }),
          }))
        ],
      },
    ]
  },
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
tannerlinsleycommented, Jan 17, 2018

Yep On Wed, Jan 17, 2018 at 10:55 AM Adam Chen Wei notifications@github.com wrote:

That maybe the reason… gotcha. so if I loading page correctly with Link, I guess I shouldn’t be experiencing the nacked html?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/nozzle/react-static/issues/298#issuecomment-358387856, or mute the thread https://github.com/notifications/unsubscribe-auth/AFUmCedPAhhZ6NU0X_q-xjfdL1mLSw7aks5tLjQngaJpZM4RdqC- .

0reactions
adamchenweicommented, Jan 17, 2018

That maybe the reason… gotcha. so if I loading page correctly with Link, I guess I shouldn’t be experiencing the naked html?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Raw Html Flash between route change · Issue #298 - GitHub
Between transition of route, I experiencing this flash of raw html... What is the cause? Is there a solution? Any hint?
Read more >
Building a Router with Raw React - James K Nelson
Routing means doing something in response to a change in the browser's current URL. There are two ways you can accomplish this: pushState ......
Read more >
Why is Html.Raw escaping ampersand in anchor tag in ASP ...
This is happening because something in the pipeline (I'd guess razor but I'd need to look it up) attribute encodes all attribute values....
Read more >
ESP32 Web Server using SPIFFS (SPI Flash File System)
In this In this tutorial we'll show you how to build a web server that serves HTML and CSS files stored on the...
Read more >
HTML and CSS Tutorial - Nanyang Technological University
Basic HTML and CSS Tutorial for the beginners.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found