Skip to content

Instantly share code, notes, and snippets.

import { SyntheticEvent, useCallback, useReducer, useState } from 'react';
/** Controls a single form value. */
export interface FormValueController<T> {
/** The current value. */
readonly value: Readonly<T>;
/** Sets the value. */
set(value: T): void;
}
import React from 'react';
import useForm, { FormValueController } from './useForm';
function App(): JSX.Element {
const form = useForm({
initialValues: {
name: '',
email: '',
},
onValidate(values, errors) {
@tmazeika
tmazeika / caspian.css
Created June 2, 2015 03:23
JavaFX default Caspian style sheet.
/*
* Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*