{"repo":"quantizor/buttermilk","free":true,"listed":false,"github":"https://github.com/quantizor/buttermilk","clone":"git clone https://github.com/quantizor/buttermilk.git","description":"beautifully simple isomorphic routing for React projects","language":"JavaScript","stars":109,"topics":["react","routing","isomorphic"],"license":"MIT","category":"ui-components","readme_excerpt":"buttermilk - buttermilk - installation - usage - basic example - writing route configurations - components - - - - utilities - match(routes, url) - route() - holistic example - without a bundler - more examples - goals - browser compatibility - internet explorer installation Grab the buttermilk NPM module with your favorite package manager. migrating from v1 1. Upgrade all react dependencies (and buttermilk, of course): 2. If you are dynamically-importing components for any routes, wrap the import in React.lazy() (note that this only works in the browser right now because React.Suspense doesn't work server-side yet.) ✅ ⛔️ 3. ?? 4. Profit! usage Setting up buttermilk involves placing a component on your page and feeding it an array of route definitions. If you learn better by reverse engineering, check out the holistic example. basic example With the above setup, a URL like \"https://yoursite.com/foo\" would trigger the FooPage component to be rendered. All other paths would trigger the NotFoundPage component. writing route configurations Buttermilk has a highly flexible matching system, offering the following flavors of routing: flavor syntax ------------------ ----------------------------- static \"/foo\" dynamic fragments \"/foo/:id\" optional fragments \"/foo(/bar)\" wildcard \"/foo \" splat \"/foo/ /bar.html\" query string \"?foo=bar\" fallback \" \" function callback yourValidationFunction(url) regex /^(?=bar)\\/foo/ The only hard rule is there must be a fallback route at the end of the ","default_branch":null,"files":null,"tree":[],"storefront":"/r/quantizor","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/quantizor/buttermilk/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}