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
5
votes
2 answers

Best way to speed up a big React project by using "Snapshots" of critical routes (static renders)

We have a large and complex traditional React app that we've been building for the last couple of years. It loads an index.html injects javascript and gets data from an API as is usual. Unfortunately, cold load times are pretty bad (5 - 7 seconds on…
5
votes
1 answer

Add tailwindcss v1 to a basic react-static site using postcss-import

I am trying to set up a starter for a react-static site including tailwindcss v1 and postcss-import. I cannot get the build or start processes to resolve the @import "tailwindcss/xxx" directives. I get the same outcome with tailwindcss v0.7.4 This…
nbtech
  • 51
  • 5
4
votes
0 answers

react-static: Promise is undefined on IE11

In this react-static app I'm coding, I've noticed the aforementioned error is occurring on IE11 and below only. It's happening on some of my project's dependencies, and not on the code I wrote myself (and I'm pollyfilling the whole app with…
darksoulsong
  • 13,988
  • 14
  • 47
  • 90
3
votes
1 answer

favicon is not displayed using react-static-plugin-favicons

I would like to display a favicon using the lib react-static-plugin-favicons. I added it to my static.config.js : export default { entry: path.join(__dirname, 'src', 'index.tsx'), getRoutes: async () => { return [ { …
OmenIII
  • 191
  • 1
  • 4
  • 11
3
votes
1 answer

How to implement react static scss into project?

I am using static react template and need to implement scss. my git hub sample : https://github.com/PrasanthGokuldas/Test_ReactStatic.git i tried to add react-static-plugin-sass to package.json and included in static.config.js file as plugins:…
Prasanth
  • 31
  • 3
2
votes
1 answer

"Type '{ children: Element[]; pictureUrl: string; }' is not assignable to type 'IntrinsicAttributes & { children?: ReactNode; }'

I'm having issues with Typescript and the following message : { children: Element[]; pictureUrl: string; }' is not assignable to type 'IntrinsicAttributes & { children?: ReactNode; }' Property 'pictureUrl' does not exist on type 'IntrinsicAttributes…
OmenIII
  • 191
  • 1
  • 4
  • 11
2
votes
0 answers

How to import .ts files in static.config.js in React Static typescript template

I have problem with import .ts files in static.config.js file in my project with React Static I got this error Unexpected token { import sth from sth } When i change my static.config.js to static.config.ts i got error => File changed:…
Hubert Kuzdak
  • 23
  • 1
  • 5
2
votes
2 answers

Conditional hooks when rendering static website

I'm using react-static to generate a static website. Using useLayoutEffect from the new hook API, I get this warning during the static rendering phase (same API as server-side rendering) : Warning: useLayoutEffect does nothing on the server, because…
ostrebler
  • 940
  • 9
  • 32
1
vote
1 answer

How to handle navigation using react-static and contentful API

I'm using react-static in my application and contentful API to load my data. I have an ebooks array with each array element having a redirectUrl field which leads to a new page (part of another array called pdf) containing the pdf for that element.…
Cassandra
  • 147
  • 1
  • 2
  • 15
1
vote
1 answer

How to generate separate css files for each page in react-static

I have an app that is built with react-static. I noticed that CSS for all pages (routes) are merged into one big styles.css file. Is it possible to generate separate CSS files for each page? Now if I run build command there is one css file in the…
Anna Miroshnichenko
  • 1,143
  • 1
  • 7
  • 24
1
vote
1 answer

How to set url for images in react-static build in scss file

I'm migrating my React site to react-static. I have a css in scss files and I use react-static-plugin-sass in my project. How do I set correctly an URL for images in my scss files? I tried this: .my-page { color: rgb(70, 81, 116); &_header { …
Anna Miroshnichenko
  • 1,143
  • 1
  • 7
  • 24
1
vote
0 answers

In react-static with react-router, how can I access props.location in the route template?

I am very new to react-static and am trying to adapt an existing react-router app to use it. I have my static.config.js setup as: export default { getRoutes: async ({ dev }) => { return [ { path: '/details/someobject', …
okhobb
  • 758
  • 8
  • 22
1
vote
0 answers

react-static | Why can't I use a dynamic meta tag?

import { Head } from 'react-static' let dynamicMeta = ''; ... // this works { dynamicMeta } // this…
1
vote
1 answer

addPrefetchExcludes - TypeError: Object(...) is not a function

I need to use addPrefetchExcludes to register a dynamic route at runtime. It needs to be placed before the the app code addPrefetchExcludes Docs But i'm getting this error: I'm have that line before the declaration of the App function…
Laura Beatris
  • 1,782
  • 7
  • 29
  • 49
1
vote
1 answer

Need Help for Child Routes rendering. Parent route works fine, but child routes fall to 404

I am developing a static site using JSON data. I replaced the post data in the react-static default sample, and it works fine. Problem: When I add another route /news with a bunch of messages in another JSON, the parent route /news works fine, but…
celest cui
  • 11
  • 2
1
2 3