ジャパンフリトレーは「ドリトス ナチョ・チーズ味」(オープン価格)をリニューアルし3月31日より発売している。
Views: 0
React Hook Form は、Reactでフォームを扱いやすくするためのライブラリです。
React では通常、フォームの各入力欄を useState で管理し、それを集めてバリデーションして…という処理が必要になります。
React Hook Form を使うと、そういった作業を簡潔に書けるようになります。
具体的には以下のようなことができます:
React Hook Form の中核は useForm()
というカスタムフックです。
これは React の Hook システム(useState や useEffect など)と同じ考え方で、フォームの状態を扱えるようにしたものです。
React の設計に沿っているため、シンプルなコードが書けます
まずは useForm を使って、フォーム全体の管理を準備します。
import { useForm } from "react-hook-form";
const { register, handleSubmit, formState: { errors } } = useForm();
register
handleSubmit
errors
次に、フォームの中にある や
に
register
を使って登録します。
input {...register("title", { required: "タイトルは必須です" })} />
ここで "title"
はフィールド名です。オブジェクト形式でバリデーションルールも指定できます。
バリデーションエラーがある場合は、errors
に情報が入ります。
それを使って、該当する入力欄の下にエラー文を表示します。
{errors.title && p>{errors.title.message}p>}
送信時には handleSubmit
を使います。
バリデーションが通ったときのみ、引数で指定した関数が呼ばれます。
const onSubmit = (data) => {
console.log(data); // data は各 register() に対応する値のまとまり
};
form onSubmit={handleSubmit(onSubmit)}>
{/* 各 input 要素 */}
button type="submit">送信button>
form>
register("time", {
required: "時間の入力は必須です",
min: {
value: 1,
message: "時間は0以上である必要があります"
}
})
ちなみに、loadingはサポートしてなかったので今回私はそこだけuseStateを使いました。
ここに貼ってあるコードをコピペして使いました
Views: 0
はじめに
こんにちは、普段 Ubie で症状検索エンジンユビー(https://ubie.app/)の開発をしている江崎です。
最近、Cursor エディタや GitHub Copilot などのコーディングアシスタントツールが進化し続けていますが、社内固有のデザインシステムとの連携はまだまだ課題が残っていました。そこで社内エンジニアである sosuke とともに、Ubie Vitals というデザインシステムを MCP サーバー化することで、UI 開発の速度と精度が劇的に向上した体験を共有します。
目次
デザインシステムと開発の現状課題
MCP サーバーの登場
Ubie UI…
Source link
Views: 0
Back in the day I was a fan of the “Trebuchet MS” font. I didn’t like it large, but set fairly small I loved the look of it. Looked very website-ish — if that makes sense.
Honestly, at 12px, it still looks really nice.
The main reason I would use it is that it was considered a “web-safe” font, meaning most computers had “Trebuchet MS” installed and it would look more or less the same across those computers. On my latest-version macOS, I’ve still got it as a pre-installed system font.
I was thinking about this as Oliver Schöndorfer blogged about it recently. He points out that mobile operating systems changed the math on what is actually “web safe”.
Web-safe fonts system fonts that are pre-installed on most browsers and operating systems. While this was true 15 years ago, when you would find Arial, Times New Roman, Georgia or Verdana on Windows and Apple machines, this drastically changed with the mobile era.
Apparently none of the classic web-safe fonts are actually “web safe” anymore, which I suppose is ironic and kinda funny. I think designers have gotten more used to and OK with some differences in typography across browsers. Modern Font Stacks is a great resource for that. The whole point of a font stack is being cool with the actually used font being whichever one hits first in that list. The whole idea of system-ui
is like a font stack in a keyword by itself, and particularly well suited to very “app like” websites that are helped by looking like the operating system they are being used on. Maybe the new web safe is just typography that works fine wherever. Or maybe that’s what it always meant.
Along those lines, I think uifonts.app is a clever idea of looking at fonts in a very practical “app like” way. I like looking at beautiful typeface type specimens as much as the next fella but in the end it matters more what the typeface looks like on my boring thing not your fancy thing.
system-ui
as an option!Quick hits:
-webkit-font-smoothing: antialiased;
but David Bushell almost has me convinced otherwise as 1) it’s macOS (very literally only) 2) it can make rendered fonts look closer to other operating systems, that is, thinner. My holdup is that I generally like thicker and it will be more consistent for users on that OS. But David is convinced enough to put it in reset stylesheets, so have a think for yourself.And some more visuals!
Views: 0
Schedule 1 lets you get creative when it comes to mixing and creating new strains. Mixing can take some getting used to, especially when it comes to what ingredients you should use and in which order. Then, you get the benefit of making more money by creating strains that are worth more, which can get to the point where you average $200 or more for a strain.
Source link
Views: 0
The Universim is Now Available on Steam!
Jump straight into managing your own planets as you guide a civilization through the ages. Build the ultimate empire in The Universim, a new breed of God Game in development by Crytivo.
Source link
Views: 0
The sale date form when clicking on the “set up your sale” link formats the dates in a format the form can’t read, so the sale cannot be submitted unless you change the date to a different day and then back again
It throws the following error:
Errors:
I’m excited to see what goodies are avaialble for a good price this week!
Views: 0
2KとFiraxisGamesは本日,ストラテジーゲーム「SidMeier’sCivilizationVII」のMetaQuest3/3S向けVR版を,2025年4月10日に発売すると発表した。VR版では,ワールドマップを俯瞰したり,身を乗り出して建造物やユニットの細部を鑑賞したりといった,VRならではの視点で楽しめる。
Source link
Views: 0
超ときめき♡宣伝部が3月31日に東京・Zepp DiverCity(TOKYO)で主催ライブ「『ときめき♡超音波!!』アフターパーティLIVE」の最終公演を開催し、ゲストのコレサワと対バンを行った。
Source link
Views: 0
2025年4月2日に放送された「Nintendo Direct: Nintendo Switch 2」の中で、Nintendo Switch 2の発売日や詳細なスペックなどが発表されました。日本ではさっそく4月4日からマイニンテンドーストアでNintendo Switch 2の抽選販売の受付がスタートしたのですが、アメリカではトランプ政権による関税引き上げを受けて、予約注文の受付が延期されたことが明らかになっています。
Nintendo Delays Switch 2 Pre-Order Date in the U.S. to Assess Impact of Trump’s Tariffs – IGN
https://www.ign.com/articles/nintendo-delays-switch-2-pre-order-date-in-the-us-to-assess-impact-of-trumps-tariffs
Nintendo pulls Switch 2 pre-orders in US over Trump tariffs
https://www.bbc.com/news/articles/c78j64dqj2qo
Trump Tariff Plans Delay Nintendo Switch 2 Pre-Order Date – Game Informer
https://www.gameinformer.com/2025/04/04/trump-tariff-plans-delay-nintendo-switch-2-pre-order-date
Nintendo Switch 2 pre-orders delayed in the United States as a result of tariffs
https://www.idownloadblog.com/2025/04/04/nintendo-switch-2-pre-order-delays-tariffs/
任天堂は「Nintendo Direct: Nintendo Switch 2」の中で、Nintendo Switch 2の発売日やスペックを発表しました。また、任天堂は放送直後に公式ホームページ上でNintendo Switch 2の日本での販売価格が日本語・国内専用版が税込4万9980円になることを発表しています。なお、アメリカでのNintendo Switch 2の販売価格は449.99ドル(約6万5500円)です。
アメリカでは4月9日に予約注文の受付が開始される予定でした。しかし、任天堂はIGNやBBC、Game Informerなどの複数メディアに「アメリカにおけるNintendo Switch 2の予約注文は、関税や市場状況の変化による影響を見極めるため、2025年4月9日には開始されません。任天堂は後日、改めて予約注文の日程を更新します。ただし、発売日は2025年6月5日から変更ありません」という声明を出し、トランプ政権による関税引き上げを受け、アメリカでの予約注文の開始日時を変更することを明らかにしました。
Nintendo Switch 2はトランプ政権による関税引き上げにより大きな影響を受ける可能性があります。実際、任天堂製品の多くが中国およびベトナムで製造されており、アメリカへの輸出にはそれぞれ54%(中国)と46%(ベトナム)という高い関税が課せられることになります。任天堂はNintendo Switch 2のアメリカでの販売価格を449.99ドル、マリオカート ワールドとのセットの販売価格を499.99ドル(約7万2800円)としていますが、関税引き上げによりこの価格がさらに高くなる可能性があります。
ただし、アメリカでのNintendo Switch 2の販売価格に対しては、インターネット上で非難の声が集まっています。任天堂のアメリカ法人であるNintendo of Americaの元広報担当であるキット・エリス氏およびクリスタ・ヤン氏は、「大げさに言いたくないが、これは任天堂にとって本当の危機の瞬間のように感じられる」と述べ、Nintendo Switch 2の販売価格が高すぎることを非難していました。
アメリカの市場調査会社であるNiko Partnersのダニエル・アフマド氏は、任天堂が突如Nintendo Switch 2の予約注文を延期した理由について、「任天堂がアメリカの対中関税を見越してNintendo Switch 2の製造の一部をベトナムに移したとしても、トランプ大統領がベトナムなどの国に突然関税を課したことで、考え直しを迫られることになった可能性は十分にあります」と記しました。
なお、Nintendo Switch 2にはNVIDIA製のGPUとCPUが搭載され、AIを使った高画質化機能「DLSS」&光を正確に描画する「レイトレーシング」&映像のカクツキを減らす「G-SYNC」などに対応することや、パッケージ版ソフトにはゲームを起動するためのキーのみが保存された「キーカード」が存在することなどが明らかになっています。
さらに、実際にNintendo Switch 2を触ってみた体験レポートも公開されているので、気になる人はチェックしてみてください。
「Nintendo Switch 2」を実際に触って使ってみたレポート動画がYouTubeに続々公開中 – GIGAZINE
この記事のタイトルとURLをコピーする
Views: 0