Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
1.1 kB
1
Indexable
Never
import logo from './logo.svg';
import './App.css';
import articles  from './data/articles';
import  ArticlesList  from "./components/ArticlesList";

function App() {
  console.log(articles)
  return (
    <div className="App">
      <a>Hello!</a>
      <ArticlesList/>
    </div>
  );
}
export default App;




const articles = [
    {
        id: 1,
        title: 'Javascript',
        content: 'here is your content',
        date: '08/02/2022',
        category: ['js', 'web'],

    },
    {
        id: 2,
        title: 'Chrome',
        content: 'here is your content',
        date: '08/02/2022',
        category: ['web'],

    },
    {
        id: 2,
        title: 'Voiture',
        content: 'here is your content',
        date: '08/02/2022',
        category: [],

    },
]




export default articles;
import  articles  from "../data/articles";
function ArticlesList() {
    return(
        <div>
            {
            articles.map(article => 
                <p key={article.key}>{article.title}</p>
            )
            }
        </div>
    )
}

export default ArticlesList