Jacob Rask jacobrask Gothenburg, Sweden

jacobrask/CSS1K 412

A demonstration of what can be accomplished with only 1 K of CSS.

jacobrask/bragi 31

Node.js UPnP Media Server

jacobrask/eslint-plugin-sorting 11

ESLint plugin for sorting of various things.

jacobrask/.dotfiles 3

My configuration files.

jacobrask/bonzo 1

library agnostic, extensible DOM utility

jacobrask/browser-tools 1

Various tools to ease cross browser testing.

jacobrask/domin8 1

JavaScript DOM manipulation library

jacobrask/griddle 1

A CSS grid constructor

jacobrask/babel 0

:tropical_fish: Babel is a compiler for writing next generation JavaScript.

jacobrask/ 0

:globe_with_meridians: The Babel documentation website

Pull request review commentSitecore/jss

[JSS 13.0.5][React sample] Race condition, under load React app may render HTML from a different route

 export const routePatterns = [ //    Not needed if not using connected GraphQL. // SitecoreContext: provides component resolution and context services via withSitecoreContext // Router: provides a basic routing setup that will resolve Sitecore item routes and allow for language URL prefixes.-const AppRoot = ({ path, Router, graphQLClient }) => {-  const routeRenderFunction = (props) => <RouteHandler route={props} />;-  return (-    <ApolloProvider client={graphQLClient}>-      <SitecoreContext componentFactory={componentFactory} contextFactory={SitecoreContextFactory}>-        <Router location={path} context={{}}>-          <Switch>-            { => (-              <Route key={routePattern} path={routePattern} render={routeRenderFunction} />-            ))}-          </Switch>-        </Router>-      </SitecoreContext>-    </ApolloProvider>-  );-};--export default AppRoot;+class AppRoot extends React.Component {+  state = {+    ssrRenderComplete: false,+    contextFactory: new SitecoreContextFactory()+  }++  setSsrRenderComplete = ssrRenderComplete => {+    this.setState({+      ssrRenderComplete+    })+  }++  render() {+    const { path, Router, graphQLClient, ssrState } = this.props;++    if (ssrState && ssrState.sitecore && ssrState.sitecore.route) {+      // set the initial sitecore context data if we got SSR initial state+      this.state.contextFactory.setSitecoreContext({

The render method should not have side effects, in any applications using React.StrictMode the render method will even be run twice in development mode to dissuade you from side effects in render.


comment created time in a month



started time in 2 months