MCPcopy Index your code
hub / github.com/TanStack/router / DetailComponent

Function DetailComponent

packages/solid-router/tests/useNavigate.test.tsx:2049–2075  ·  view source on GitHub ↗
(props: { id: string })

Source from the content-addressed store, hash-verified

2047 }
2048
2049 function DetailComponent(props: { id: string }) {
2050 const params = useParams({ strict: false })
2051 const [currentTest, setTest] = useModal('test')
2052
2053 return (
2054 <>
2055 <div data-testid={`detail-heading-${props.id}`}>
2056 Post Path "/{params().postId}/detail-{props.id}"!
2057 </div>
2058 {currentTest() ? (
2059 <button
2060 data-testid={`detail-btn-remove-${props.id}`}
2061 onClick={() => setTest(false)}
2062 >
2063 Remove test
2064 </button>
2065 ) : (
2066 <button
2067 data-testid={`detail-btn-add-${props.id}`}
2068 onClick={() => setTest(true)}
2069 >
2070 Add test
2071 </button>
2072 )}
2073 </>
2074 )
2075 }
2076
2077 const PostComponent = () => {
2078 const params = useParams({ strict: false })

Callers

nothing calls this directly

Calls 2

useParamsFunction · 0.90
useModalFunction · 0.70

Tested by

no test coverage detected