function LoginForm() {
const [state, dispatch] = useActionState(loginFormAction, {});
const [_isPending, formAction] = useFormAction(async (formData, form) => {
dispatch({ type: "RESET" });
const errors = validateForm(formData);
if (errors != null) {
dispatch({ type: "SET_INVALID_INPUTS", form, errors });
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"imports": { | |
"#styled-system/*": "./src/styled-system/*/index.js", // remove if you don't use pandacss | |
"#*": { | |
"react-server": [ | |
"./src/*.ts", | |
"./src/*.tsx", | |
"./src/*.server.ts", | |
"./src/*.server.tsx" | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @see https://prettier.io/docs/en/configuration.html | |
* @type {import("prettier").Config} | |
*/ | |
const config = { | |
trailingComma: "all", | |
printWidth: 120, | |
tabWidth: 2, | |
arrowParens: "always", | |
semi: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
// ..., | |
"imports": { | |
"#styled-system/*": "./src/styled-system/*/index.js", | |
"#*": [ | |
"./src/*.ts", | |
"./src/*.tsx", | |
"./src/*" | |
] | |
} |
Example:
function Form() {
const [isPending, onSubmit] = useFormActionHandler((formData, reset) => {
if (formData.get('condition') === 'X') {
reset();
}
// ...
});
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is Git's per-user configuration file. | |
[user] | |
name = BaHwan Han | |
email = [email protected] | |
[push] | |
default = current | |
[core] | |
pager = delta |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const config = { | |
// ... | |
webpack(config) { | |
// prevent ehters.js node deps import warnings | |
config.externals.push({ | |
bufferutil: "bufferutil", | |
"utf-8-validate": "utf-8-validate", | |
}); |
wtf going on React?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
ClientBuilder, | |
ClientDependenciesBuilder, | |
ClientFooterBuilder, | |
ClientGeneratorsBuilder, | |
ClientHeaderBuilder, | |
ClientTitleBuilder, | |
generateFormDataAndUrlEncodedFunction, | |
generateMutatorConfig, | |
generateMutatorRequestOptions, |