Questions tagged [react-static]

react static site generator developed by nozzle

Building progressive applications and websites.

Generates a base application (of your chosen theme) and gives you clear extensions points to append your own code.

https://github.com/nozzle/react-static

38 questions
1
vote
0 answers

How to render the menu from the routes defined at static.config.js file in an application build by react-static?

Following the official guide, it should be something simple like this: //App.js import React from 'react' import { useRouteData } from 'react-static' const { myRoutes} = useRouteData() function App() { console.log(myRoutes.length) return ( …
MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
1
vote
1 answer

Is there a way to add a favicon in react-static?

I saw this enter link description here and I add favicon like this import path from 'path'; import React from 'react'; export default { Document: ({ Html, Head, Body, children, state: { siteData, renderMeta }, }) => ( …
minimin_bamm
  • 109
  • 10
1
vote
1 answer

TypeError: Cannot read property 'string' of undefined when adding google-tag-manager to reactjs site

My site is build on react-static,a framework based on reactjs. I follow the google guide for adding the react-google-tag-manager to the project. When i refresh page i get the following error on the browser, for GoogleTagManager module: TypeError:…
MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
1
vote
1 answer

Error: Failed exporting HTML for URL About (src\pages\About.js): Invariant failed

I add Switch router component to my project in order to set default page. When i build it gives the following error: Error: Failed exporting HTML for URL About (src\pages\About.js): Invariant failed - tiny-invariant.cjs.js:11 invariant …
MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
1
vote
1 answer

Error: 'You may need an appropriate loader to handle this file type' when building react-static site

I got this error when building the site with react-static: ERROR in ERROR in C:/Users/.../test/artifacts/react-static-templates.js 1:1016 C:/Users/.../test/artifacts/react-static-templates.js 1:1016 Module parse failed: Unexpected token…
MiguelSlv
  • 14,067
  • 15
  • 102
  • 169
1
vote
2 answers

How are gatsby, react-static, netlify, netlify cms, and contentful related or used together?

I'm trying to learn more about static sites and the various tools around them. So I think: Gatsby and React-Static are tools/way of taking JSON data and making a static fast loading site. Something that can be uploaded right into s3 or a cloud…
Kyle Pennell
  • 5,747
  • 4
  • 52
  • 75
1
vote
1 answer

Client Side AJAX Request on React-Snap

I am using react-snap package with my React Application which can generate basically a static form of my whole application. But it actually crawls all the AJAX data and fetches them then build the static site. But I want react-snap to skip some of…
zonayedpca
  • 37
  • 5
1
vote
0 answers

Make the outer layout aware of the current route in react static

My app has a structure like this: const App = () => ( ) However, I would like to make the layout depend on the type of page that is loaded. I know that there is a…
Xiphias
  • 4,468
  • 4
  • 28
  • 51
0
votes
0 answers

How to detect URL changes for SEO in react static project

When i navigate from one page to other i need to load my google tag manager. But currently only when i reload page it happens else it wont. I am using react static project. sample link :…
Prasanth
  • 31
  • 3
0
votes
1 answer

React-static build error: ERR_REQUIRE_ESM or ReferenceError: window is not defined

I have no idea how to solve this, but I tried many things that are probably just silly. I'd just like to finish changing my react-app to be a react-static-app, so I can finish my project. Everething works localy and I kind of know it has something…
ucimo
  • 105
  • 11
0
votes
0 answers

How to generate static html page from a react code on nodejs server with REST API call as a trigger?

Is it possible to generate a static HTML page from a react code and REST API as a trigger? I will provide a use case to describe my issue. Assuming I'm building a simple notes SPA react app using creat-react-app. The UI allows the user to view the…
RanST
  • 404
  • 2
  • 6
  • 20
0
votes
0 answers

Document is not defined - Using React Tooltip lib with a React Static

I'm using a lib called react-tooltip with a framework called react-static. But the problem is that it doesn't support SSR and I'm having some issues with it during the build time. I also tried to verify the document and if it's undefined return…
Laura Beatris
  • 1,782
  • 7
  • 29
  • 49
0
votes
1 answer

What is the best way to have a React-generated static (SEO) "public" frontend alongside a CRA "private" app?

I've been using Create-React-App and dig the whole setup, basically I'm looking to keep developing with JSX instead of switching to Gatsby/React-Static's Markdown/etc coding style. Similar question to this one regarding Gatsby. I'm looking to have a…
Phil Gresham
  • 11
  • 1
  • 4
0
votes
1 answer

How do I use NavLink in React Static 7?

I am updating a React Static website that was created with version 5.9.12 to version 7.2.2. It seems that NavLink was removed from React Static. With the following code I get an error: Cannot create styled-component for component: undefined. import…
0
votes
2 answers

React-Static scroll to top on page change

Is there a way to scroll to the top when the page change with react-static ? I'm using @reach/router which is include by default with react-static. I've already tried this :
Pol
  • 1,132
  • 1
  • 11
  • 35