Last active
January 11, 2022 22:13
-
-
Save smoralb/4b687ce11e2616ad1cfd2b9cdc03770c to your computer and use it in GitHub Desktop.
This file contains 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
import './App.css' | |
import SectionItem from './components/section-item/sectionItem' | |
import { useTranslation } from 'react-i18next' | |
import React from 'react' | |
export default function App () { | |
const { t } = useTranslation() | |
var section = t('section', { returnObjects: true }) // Return the array from my local JSON file | |
return ( | |
<div className='App'> | |
{section && | |
section.length > 0 && | |
section.map(item => { | |
return ( | |
<React.Fragment key={item.title}> | |
<SectionItem item={item} /> | |
</React.Fragment> | |
) | |
})} | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment