Serve a new html page onclick
Unanswered
Japanese anchovy posted this in #help-forum
Japanese anchovyOP
hello guys, I want to be able to serve an html page onclick of a article title, but I don't know how to go about implementing this. I'm using server component as my frontend with my rust backend (this latter just sends the serialized data over http)
this is the code where I want to add the onClick action
const listItems = data.map((fields: any, index: any) =>
<div className="article-container">
<h2 className="title">
<a href={
{fields.title}
</a>
</h2>
<p className="summary">{fields.summary}</p>
<p className="date">{formatted_date[index]}</p>
</div>
);
return <div className="article">{listItems}</div>
this is the code where I want to add the onClick action
const listItems = data.map((fields: any, index: any) =>
<div className="article-container">
<h2 className="title">
<a href={
/article/${fields.title}} className="title">{fields.title}
</a>
</h2>
<p className="summary">{fields.summary}</p>
<p className="date">{formatted_date[index]}</p>
</div>
);
return <div className="article">{listItems}</div>