Archives : June-2020

I want to wire up two production-style builds in my React 16.13 project. One for the test environment and another for the production. I have configured the below scripts … "scripts": { "start": "react-scripts start", "build": "NODE_ENV=development react-scripts build", "build:test": "NODE_ENV=test react-scripts build", "build:prod": "NODE_ENV=production react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject" }, I ..

Read more

We have an SPA, written in React together with ASP.net core for hosting. To authenticate the app, we are using IdentityServer4 and use a cookie. The client is configured according to the sample, described here: https://github.com/IdentityServer/IdentityServer4/tree/main/samples/Quickstarts/4_JavaScriptClient/src For authenticating a user, everythings works fine. It will be redirected to the login page. After signing in, redirection ..

Read more

The website build is at https://5ef7e508e9ddb351ca03cf75–epic-raman-086510.netlify.app/ . It looks like the javascript isn’t running, and only the html version(supposed to only be displayed to search engines) is being displayed. I was having a similar problem locally, when I ran gatsby develop. This problem went away after I ran npm update and removed .cache public/ yarn.lock(I’m ..

Read more

I’m starting to use React-Router v6, and running into issues animating route transitions. Both the react-router docs and the react-transition-group docs specify ways that are not compatible with the new v6 api. The primary reason seems to be the removal of the <Switch> component. In [email protected], this worked: import { Router, Route, Switch, useLocation } ..

Read more

Using React Router Config (https://github.com/ReactTraining/react-router/tree/master/packages/react-router-config), I have the following routes config file: export const routes: RouteConfig[] = [ { component: injectRoutes(HomeLayout), path: "/home/(componentx|componenty)", routes: [ { component: ComponentX, exact: true, path: "/home/componentx", }, { component: ComponentY, exact: true, path: "/home/componenty", }, ], }, ]; My injectRoutes function is a little HOC to construct the child ..

Read more

I’m porting an angular app to reactjs. almost work done but stuck at one point. Here’s my code: <div class="no-js one-page-layout sound-effects" [ngClass]="{‘is-card-loaded loaded is-card-open is-card-opened’:isCardOpen, ‘is-ajax-page-active is-ajax-page-loaded’: isSectionOpen}" [ngClass.xs]="{‘is-card-loaded loaded is-card-open is-card-opened’:true, ‘is-ajax-page-active is-ajax-page-loaded’: isSectionOpen}" [ngClass.md]="{‘is-card-loaded loaded is-card-open is-card-opened’:true, ‘is-ajax-page-active is-ajax-page-loaded’: isSectionOpen}"> <router-outlet></router-outlet> </div> [ngClass.xs] available in angular flexlayout https://github.com/angular/flex-layout/wiki/ngClass-API In the above code, ..

Read more