acdlite / acdlite/redux-router

TypeError: Cannot read property 'location' of undefined React Router useRouteMatch issue

オープン
#298 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
2.3k
フォーク
194
PR マージ指標
30日以内にマージされた PR はありません

説明

I can't solve this problem, "TypeError: Cannot read property 'location' of undefined " in my reactjs project. I am trying to nesting the url for blog post but not working it, and I have test it's math by console it's take the path but nesting showing error.

Below the code which I have tried but not solving

`
import React, { Component } from 'react';
import { Router, Link, Switch, useRouteMatch } from 'react-router-dom';
export default function Blogs(){
const match = useRouteMatch();
console.log(match.path)
return (





Latest Blogs




{/* */}







)
}

const PostListing = ()=> {
return (


)

}

const PostItem = (props) => {
return (





{""}






{props.postTitle}




Post Date: {document.lastModified}



)
}

///

`

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。