Skip to content

Instantly share code, notes, and snippets.

Created August 20, 2021 03:27
What would you like to do?
import {useEffect } from 'react'
import {useHistory} from 'react-router-dom';
import Parse from 'parse';
import './Home.css'
export default function Home() {
const initialPosts = [{
userName: 'User 1',
post: "Hi, I'm a placeholder"
const history = useHistory();
useEffect(() => {
async function checkUser() {
const currentUser = await Parse.User.currentAsync();
if (!currentUser) {
alert('You need to be logged in to access this page');
}, []);
return (
<div className="App">
<header className="app-header">
<img className="logo" alt="back4app's logo" src={''} />
<h2 className="spacing">parse hooks</h2>
<span>social network</span>
<div className="posts-container">
<div className="actions">
<textarea />
<div className="post-list">
{initialPosts &&{userName, post},index) => (
<div className="post" key={index}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment