Skip to content

Instantly share code, notes, and snippets.

View kylebuildsstuff's full-sized avatar

Kyle kylebuildsstuff

View GitHub Profile
// reducer.js
export const initialState = {
authenticated: false,
authenticating: false,
};
export const loginReducer = (
state = initialState,
action
) => {
import React from 'react';
export const SomeComponent = () => {
return (
<div className="flex justify-center items-center">
what
</div>
);
}
.someClassName {
display: flex;
justify-content: center;
align-items: center;
}
export const SomeComponent = () => {
return (
<div className="someClass">
what
</div>
);
}
...
<form
className="w-80"
onSubmit={handleSubmit(onSubmit)}
>
...
export const FormContainer = props => {
const submitForm = (formValues) => {
console.log('submitting Form: ', formValues);
}
return (
<FormComponent
formValues={props.formValues}
change={props.change}
onSubmit={submitForm}
<form>
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="other"> Other
</form>
{
"name": "redux-form-v7-example",
"version": "0.1.0",
"private": true,
"dependencies": {
"moment": "^2.18.1",
"react": "^15.6.1",
"react-addons-shallow-compare": "^15.6.0",
"react-dates": "^12.6.0",
"react-dom": "^15.6.1",
import React from 'react';
export const Checkbox = props => {
return (
<div className="flex items-center mv4 w-100">
<input
{...props.input}
className="mr2"
type="checkbox"
checked={props.input.value}
<Field
name="spiceLevel"
label="Spice Level"
component={Radio}
options={{
mild: 'Mild',
medium: 'Medium',
hot: 'hot'
}}
/>