I am trying to fix this lint error at line const def = (props) => {
in following sample code.
const propTypes = {
prop1: PropTypes.string,
pr
Possible way is (sure you can change array declaration to getting from db or another external resource):
const MyPosts = () => {
let postsRawData = [
{ id: 1, text: 'Post 1', likesCount: '1' },
{ id: 2, text: 'Post 2', likesCount: '231' },
{ id: 3, text: 'Post 3', likesCount: '547' }
];
const postsItems = []
for (const [key, value] of postsRawData.entries()) {
postsItems.push( )
}
return (
Posts:
{postsItems}
)
}