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>
お金のむこうに人がいる 元ゴールドマン・サックス金利トレーダーが書いた 予備知識のいらない経済新入門
[ad] お金のむこうに人がいる 元ゴールドマン・サックス金利トレーダーが書いた 予備知識のいらない経済新入門
田内学 (単行本(ソフトカバー))