created: 2021-05-02T09:52:59.000Z

React-admin の登録/更新画面でreadonlyなフィールドをつくる

Listコンポーネントで使う TextField などのコンポーネントを使えばよい。

A Field component displays a given property of a REST resource. Such components are used in the List and Show views, but you can also use them in the Edit and Create views for read-only fields.

  <Edit {...props}>
    <SimpleForm>
      // userId は readonly
      <TextField source="userId" />
      // expireAt は日付データのinput
      <DateInput source="expireAt" />
    </SimpleForm>
  </Edit>
ERROR FREE 世界のトップ企業がこぞって採用したMIT博士のミスを減らす秘訣
[ad] ERROR FREE 世界のトップ企業がこぞって採用したMIT博士のミスを減らす秘訣
邱強, 牧髙光里 (Kindle版)