Skip to content

Instantly share code, notes, and snippets.

Trần Văn Luận luandevpro

  • Viet Nam
Block or report user

Report or block luandevpro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Spring.js
import React, { useState } from 'react';
import { Transition } from 'react-spring/renderprops';
import Nav from './Nav';
function UseSpring() {
const [display, setDisplay] = useState(false);
return (
<div>
<Transition
items={display}
View Nav.js
import React from 'react';
import styled from 'styled-components';
const Nav = ({ display, setDisplay, style }) => (
<NavStyled>
<BackgroundStyled
onClick={() => setDisplay(!display)}
style={{
opacity: style.bgOpacity,
}}
View vvsdv.md

To create anchor links that jump down to different sections of a README (as in an interactive table of contents), first create a heading:

Real Cool Heading

The anchor link for that heading is the lowercase heading name with dashes where there are spaces. You can always get the anchor name by visiting the README on Github.com and clicking on the anchor that appears when you hover to the left of the heading. Copy everything starting at the #: #real-cool-heading

Wherever you want to link to your Real Cool Heading section, put your desired text in brackets, followed by the anchor link in parentheses: Go to Real Cool Heading section

header text here {#anchorName}

See! Easy: Go to Real Cool Heading section

View TextInput.js
import React from 'react';
import { TextField } from '@material-ui/core';
import { ErrorMessage } from 'formik';
export default (props) => {
return (
<div>
<TextField
id="input-with-icon-grid"
label={props.label}
View validation.js
import * as Yup from 'yup';
export const validationSchema = Yup.object().shape({
email: Yup.string()
.email('Please enter a valid email')
.required('Please enter an email'),
});
View TextInput.js
import React from 'react';
import { TextField } from '@material-ui/core';
export default (props) => {
return (
<TextField
id="input-with-icon-grid"
label={props.label}
name={props.name}
style={{ width: props.width, marginTop: props.marginTop }}
View FormField.js
import { Form, Field } from 'formik';
import TextInput from './TextInput';
export default () => (
<div>
<Form>
<Field
name="name"
component={TextInput}
label="Name"
View FormPro.js
import React, { useState } from 'react';
import { Formik } from 'formik';
import FormField from './FormField';
function FormPro() {
const [values] = useState({ name: '', email: '' });
const handleSubmit = (values, { resetForm }) => {
console.log(values);
resetForm({
name: '',
View index.js
const { ApolloServer , gql } = require("apollo-server-express")
const express = require("express")
const { Prisma } = require("prisma-binding")
const app = express()
const { User } = require("./typeDefs")
const { resolverQuery } = require("./resolvers")
const apollo = new ApolloServer({
typeDefs: [ User ],
resolvers: [resolverQuery],
View index.js
const { Query } = require("./query")
const resolvers = {
resolverQuery: Query
}
module.exports = resolvers
You can’t perform that action at this time.