Skip to content

Instantly share code, notes, and snippets.

@dabit3
dabit3 / create-post.js
Last active January 17, 2021 02:41
Next.js + Amplify - pages/create-post.js
// pages/create-post.js
import { useState } from 'react';
import { AmplifySignOut, withAuthenticator } from '@aws-amplify/ui-react';
import { css } from 'emotion';
import { useRouter } from 'next/router';
import { createPost } from '../src/graphql/mutations';
import { API } from 'aws-amplify';
function CreatePost() {
const [formState, updateFormState] = useState({ name: '', content: ''});