feat(react-router): allow `useMatch` to not throw if match was not found
in this case, matchRoute will return undefined
☁️ Nx Cloud Report
CI is running/has finished running commands for commit ff43790013d65d9d29584b5ad145ca66f1b21f68. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
✅ Successfully ran 3 targets
Sent with 💌 from NxCloud.
To me this makes sense, I think matchRoute is not the same because it doesn't provide the same stuff a useMatch and its definitely possible users might want to conditionally render based on a match or not.
I think we just need to think about if select should be called if the match is undefined
Run & review this pull request in StackBlitz Codeflow.
commit: ff43790
@tanstack/history
npm i https://pkg.pr.new/@tanstack/history@1738
@tanstack/react-cross-context
npm i https://pkg.pr.new/@tanstack/react-cross-context@1738
@tanstack/react-router
npm i https://pkg.pr.new/@tanstack/react-router@1738
@tanstack/react-router-with-query
npm i https://pkg.pr.new/@tanstack/react-router-with-query@1738
@tanstack/router-cli
npm i https://pkg.pr.new/@tanstack/router-cli@1738
@tanstack/router-devtools
npm i https://pkg.pr.new/@tanstack/router-devtools@1738
@tanstack/router-generator
npm i https://pkg.pr.new/@tanstack/router-generator@1738
@tanstack/router-plugin
npm i https://pkg.pr.new/@tanstack/router-plugin@1738
@tanstack/router-vite-plugin
npm i https://pkg.pr.new/@tanstack/router-vite-plugin@1738
@tanstack/start
npm i https://pkg.pr.new/@tanstack/start@1738
@tanstack/start-vite-plugin
npm i https://pkg.pr.new/@tanstack/start-vite-plugin@1738
templates
- tanstack-router-react-example-authenticated-routes
- tanstack-router-react-example-basic
- tanstack-router-react-example-basic-default-search-params
- tanstack-router-react-example-basic-file-based
- tanstack-router-react-example-basic-file-based-codesplitting
- tanstack-router-react-example-react-query
- tanstack-router-react-example-basic-react-query-file-based
- tanstack-router-react-example-basic-ssr-file-based
- tanstack-router-react-example-basic-ssr-streaming-file-based
- tanstack-router-react-example-deferred-data
- tanstack-router-react-example-kitchen-sink
- tanstack-router-react-example-kitchen-sink-file-based
- tanstack-router-react-example-kitchen-sink-react-query
- tanstack-router-react-example-kitchen-sink-react-query-file-based
- tanstack-router-react-example-large-file-based
- tanstack-router-react-example-location-masking
- tanstack-router-react-example-navigation-blocking
- tanstack-router-react-example-quickstart
- tanstack-router-react-example-quickstart-file-based
- tanstack-router-react-example-quickstart-rspack-file-based
- tanstack-router-react-example-quickstart-webpack-file-based
- tanstack-router-react-example-scroll-restoration
- tanstack-router-example-react-start-basic
- tanstack-router-example-react-start-basic-counter
- tanstack-router-example-react-start-basic-react-query
- tanstack-router-example-react-start-basic-rsc
- tanstack-router-example-react-start-basic-trellaux
- tanstack-router-react-example-with-trpc-react-query
- tanstack-router-react-example-waku-rsc
- tanstack-router-react-example-with-bling
- tanstack-router-react-example-with-framer-motion
- tanstack-router-react-example-with-trpc