Статический маршрут с формойJavascript

Форум по Javascript
Ответить
Anonymous
 Статический маршрут с формой

Сообщение Anonymous »

Я использую форму на странице < /p>

Код: Выделить всё

import WRAction from "@r/src/components/we-request/WRAction";
import WRFields from "@r/src/components/we-request/WRFields";
import {weRequestFromAction} from "@ut/weRequestFromAction";
import React from "react";

const page = () => {
return (






);
};

export default page;
< /code>
weRequestFromAction
функция - это просто пустая функция

Код: Выделить всё

export async function weRequestFromAction(formData: FormData) {
"use server";
}
< /code>
where WRFields it is just a component with two required field and bunch of useless UI
import Field from "@r/src/ui/field/Field";
import React from "react";

const WRFields = () => {
return (




);
};

export default WRFields;
< /code>
and WRAction just component with custom but regular html button
с типом = "Отправить"
import RoundedButton from "@r/src/ui/buttons/RoundedButton";
import React from "react";

const WRAction = () => {
return (



);
};

export default WRAction;
< /code>
Question: Why when I load a page in the bottom left corner in Nextjs >15, I usually have a "static route" icon, but on first load it doesn't. But when I submit the form or click the button, this icon appears. Why so? Does this mean the page doesn't display static(aka user render as i understand) unless I click the button and submit the form?
First load:
Изображение

Button click and submit form:
Изображение


Подробнее здесь: https://stackoverflow.com/questions/794 ... -with-form
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Javascript»