Open
Conversation
hikahana
reviewed
Nov 14, 2025
Contributor
hikahana
left a comment
There was a problem hiding this comment.
できればですが、毎回PR消さなくても良いです!
どこで何のコメントしてどうなっているかの情報把握が少し面倒になりそうなので!!!
お願いします~
Contributor
There was a problem hiding this comment.
ちょっと差分以外のところにコメントできないからここで
下みたいにsortedNewsを消したところをnewsにしたらエラー無く動くと思っているんだけどどうですかね?
エラーの詳細についても貼ってもらえるとうれしいかもです。
const { news, error, isLoading } = useGetNews();
~略~
const newsList = news.map((item, index) => {
const date = formattedDates[index] ?? 'お知らせはありません。';
Collaborator
Author
Contributor
There was a problem hiding this comment.
これで解決できると思われ
const NewsList: FC<NewsListProps> = () => {
const { news, error, isLoading } = useGetNews();
if (news === undefined) return [];
const formattedDates = news.map((item) => {
const date = new Date(item.createdAt);
const formattedDate = format(date, 'yyyy/MM/dd');
return formattedDate;
});
const newsList = news.map((item, index) => {
const date = formattedDates[index] ?? 'お知らせはありません。';
return (
<div key={item.id} className="flex flex-col gap-2">
<span className="w-24 text-base font-medium text-font">{date}</span>
<span className="w-full whitespace-pre-line text-base font-medium text-font">
{item.body}
</span>
</div>
);
});
hikahana
requested changes
Dec 15, 2025
Contributor
There was a problem hiding this comment.
これで解決できると思われ
const NewsList: FC<NewsListProps> = () => {
const { news, error, isLoading } = useGetNews();
if (news === undefined) return [];
const formattedDates = news.map((item) => {
const date = new Date(item.createdAt);
const formattedDate = format(date, 'yyyy/MM/dd');
return formattedDate;
});
const newsList = news.map((item, index) => {
const date = formattedDates[index] ?? 'お知らせはありません。';
return (
<div key={item.id} className="flex flex-col gap-2">
<span className="w-24 text-base font-medium text-font">{date}</span>
<span className="w-full whitespace-pre-line text-base font-medium text-font">
{item.body}
</span>
</div>
);
});
Collaborator
|
@riririn180904 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

対応Issue
resolve #1941
概要
実装詳細
画面スクリーンショット等
テスト項目
備考
前のPRのレビューで指摘されたconst部分消したらエラーになったのでそのままにしてあります