Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
172 views
in Technique[技术] by (71.8m points)

reactjs - Listing files to generate dynamic components with list

I want a scalable solution, using React, to list some pages and automatically using the last one as my main page.

I have my 'legals mention' page, which will be regularly updated with new content.

import { useTranslation } from "react-i18next";
function Legals() {
    const { t } = useTranslation('common');
  return (
<div>
    <h1>Legals</h1>
    <span>Version 2.1 - 4th revision</span>
    <span>· Effective September 30, 2020</span>
    <button>Archived versions</button>
    {...}<Content>{...}
</div>
)}

export default Legals;

So this is supposed to display the most recent version, and contains a button with a list to older versions.

I was thinking of using i18n and check in a folder for the last version, is it the best way to do it? How to accomplish it, at least in pseudocode?

question from:https://stackoverflow.com/questions/66055454/listing-files-to-generate-dynamic-components-with-list

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...