Relative Content

Tag Archive for javascriptreactjsnext.jsreact-fullstack

Unexpected behavior in Javascript

Using the below code, I see unexpected behavior in Javascript: When clicking on any items, the website navigates to lifestyle/[id], but it does not render correct content or it raises 404 error. Why is this happening?

when i am clicking any items ,it is navigating to lifestyle/[id].. but it is not working or it is showing 404 . why it is happening? nextjs

// components/lifestyle.jsx import React from ‘react’; import Link from ‘next/link’; import _ from ‘lodash’; const Lifestyle = ({ news }) => {  const sortedNews = _.sortBy(news, ‘published_date’).reverse();     return (   <div>    <h1 className=”text-2xl sm:text-3xl text-center text-black font-bold p-1 rounded-xl”>LifeStyle</h1>    {sortedNews.length > 0 && (     <div className=’flex flex-col lg:flex-row justify-center p-2 lg:pr-3 gap-2 lg:border-r-2 border-gray-400′>      {sortedNews.slice(0,3).map((item, […]