Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
197 views
in Technique[技术] by (71.8m points)

javascript - Why my react app appeared no script tag in the body of the html?

I am working on a react app and I have encountered an error which is when the user logged in, the app will push the user to the dashboard, but the dashboard showed nothing even though it has the h1 tag on the jsx (but other pages work perfectly except dashboard). The html of the dashboard showed "You need to enable JavaScript to run this app." . Anyone can help? Thanks in advance and have a nice day :)

dashboard code:

export class Dashboard extends Component {
  render() {
     return (
      <h1>
        hello
      </h1>
    )
  }
}

dashboard's html:

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For the sake of UX, it renders that to inform users that this website need JavaScript ( they may disabled it manually ) and they shouldn't wait for the website to show up; and/or clears the confusion that the website is not broken ( due to errors or something )


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...