This will fix the example with useSuspenseQuery for the Router loader. You cannot just write `const posts = useSuspenseQuery(...)` but have to resolve the data property as so `const {data: {posts}} = useSuspenseQuery(...)`
Be sure to re-run generator after upgrading
* perf: get lazy? do less?, generate more
* feat: add support for objects for children at runtime
- add type tests for objects with children
- add runtime support for objects with children
- add runtime tests for objects with children
* perf: apply similar optimisations for merging for code based
* perf: improve performance of LinkProps when passed to `Link`
* exmaples: add to large based file examples search, params and context
* docs: add TS performance recommendations to docs
* fix: remove route groups from id
* examples: update linkprops examples
* docs: update docs based on comments
* chore: remove export of `LinkComponentProps`
* chore: clean up PR
---------
Co-authored-by: Lachlan Collins <1667261+lachlancollins@users.noreply.github.com>
* docs: callouts in the file-based routing conventions
* docs: make the callouts related their properties/options
* docs: emojis!
* docs: add a callout in the "file-naming conventions" section
* docs: use a single callout in the "options" sections
* docs: better callout in the 'file-naming conventioned' section
* docs: missing words
* docs: that should be it
* docs: be a bit more obvious about the `-`
* docs: rename the authenticated-routes example
* docs: update the authenticated-routes example to use layouts
* docs: trim up the authenticated routes example
* docs: default navigation to `/dashboard`
* docs: add auth persistence
* feat(router-generator): append and prepend lines to the generated route-tree
* test(router-generator): making sure it works!
* refactor(router-generator): rename the prepend and append properties
* docs: docs on the new prepend and append functionality
* refactor(router-generator): update configuration property names
* test(router-generator): update the tests with the new configuration property names
* docs: update file-based routing guide with the new property names
* refactor(router-generator): move to the defaults
* test(router-generator): updated test output
* docs: show what the defaults are on the docs
* docs: add migration guide for react-location
* chore: show the react-location migration guide
* docs: remove the word "over"
* docs: make ssr a guide to feature
- Fixed an issue where preloads would redirect and not resolve to the correct location
- Removed the need for `getRenderedMatches`. The matches intended to be rendered are now always stored at `store.matches`
- Removed the experimental ability for async meta and headers. Loaders should be used to get async data into these functions
- Pending matches now take `beforeLoad` into account and properly start pendingMs timers.
- `pendingMinMs` is also more accurate now by only triggering its timers when the pending state is encountered during rendering
- Removed a logical path where the `pending` component could be directly rendered within a route instead of handled by suspense
- Matches that don't require loaders or beforeLoaders will start as "success".
- Meta and headers are now called and saved for matches that are cached or already in the "success" state
- Fixed an issue where redirects and not-found errors would get improperly swallowed
- Fixed an edge-case where outdated navigations were not ignored and created race-conditions
- Refactored isServer into the router so we can do some better mocking in tests
- Added tests around scripts, meta, and redirects
- Fixed issues with non-vinxi server envs
- Injected html now waits for <body>
Closes#1104#1146#1168
* feat(react-router): mark the `navigate` function in the `beforeLoad` and `loader` callbacks as deprecated
* docs: mark the navigate function passed into the `beforeLoad` and `loader` functions as deprecated
Investigation into the broken links found by @MarcoB-Ec lead me to discovered these were broken in the top-level docs as well.
Co-authored-by: Marco Brito <35307131+marcob-ec@users.noreply.github.com>
* feat: add reset prop to errorComponent
* fix: types of defaultErrorComponent
* fix: put match into pending state when being invalidated if it was in error state
* docs: reset
* docs: error handling
* docs: integrate error handling into example
* chore: prettier on md files
* chore: fix wrong auto import
* fix: reset error boundaries from react-query in an effect
so that navigating away from a route will also re-trigger the query
* docs: error handling with TanStack Query
* chore: fix eslint
* fix: not all error components have a `preload`
* fix: merge conflict
* feat(react-router): return the useNavigate hook
* docs(react-router): update verbiage on the RouteClass doc
* test(react-router): ensure the typed hooks are available across the shared surfaces
* docs: add createLazyFileRoute
* docs: broken link to the FileRouteClass
* docs: remove the word literal
* docs: update the source of its configuration options
* docs: add createLazyRoute
* feat(router-generator): expose config to accept `semicolons` prop to prettier format with semicolons
* docs(router-generator): document the new `semicolons` configuration property
* fix: peerDependencies
* docs: requirements
* ci: run type tests against multiple TS versions
* chore: newline
* chore: fix prettier
* fix: wrappers must return a JSX Element
* fix: have Explorer return JSX.Element
* fix: another one
* docs: broken link linking to the SSR guide
* docs: broken link linking to the `RouterOptionsType#transformer-property`
* docs: fix broken link linking to code-splitting
* docs: fix broken link linking to the `RouterOptionsType`
* docs: fix broken link linking to external-data-loading
* docs: include layout as part of the pathless routes section
* docs: add links to the individual sections below
* docs: links for the route nesting stuff
* docs: move the routing concepts section to separate page