From 0563263b9d57476ed62ed11593094a01306bbcc4 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Fri, 11 Jul 2025 13:07:25 -0700 Subject: [PATCH] Fix props for `` element. Fix #335 --- apps/website/docs/api/03-html/09-option.md | 5 ++--- apps/website/docs/api/03-html/10-select.md | 8 +++++--- .../src/types/StrictReactDOMOptionProps.js | 1 - .../src/types/StrictReactDOMSelectProps.js | 4 +++- .../tests/__snapshots__/html-test.js.snap-dom | 3 ++- packages/react-strict-dom/tests/html-test.js | 9 +++------ 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/apps/website/docs/api/03-html/09-option.md b/apps/website/docs/api/03-html/09-option.md index 3a131afc..2c7c8887 100644 --- a/apps/website/docs/api/03-html/09-option.md +++ b/apps/website/docs/api/03-html/09-option.md @@ -14,8 +14,8 @@ To display an item within ``, render the `` component. import { html } from 'react-strict-dom'; const Foo = () => ( - - Red + + Red ); ``` @@ -25,5 +25,4 @@ const Foo = () => ( * [...Common props](/api/html/common/) * `disabled` * `label` -* `selected` * `value` diff --git a/apps/website/docs/api/03-html/10-select.md b/apps/website/docs/api/03-html/10-select.md index 8ec29bec..3dcf08d4 100644 --- a/apps/website/docs/api/03-html/10-select.md +++ b/apps/website/docs/api/03-html/10-select.md @@ -8,14 +8,14 @@ title: ## Overview -To display a select box, render the `` component. ```jsx import { html } from 'react-strict-dom'; const Foo = () => ( - - Red + + Red ); ``` @@ -24,6 +24,7 @@ const Foo = () => ( * [...Common props](/api/html/common/) * `autoComplete` +* `defaultValue` * `multiple` * `name` * `required` @@ -32,3 +33,4 @@ const Foo = () => ( * `onInput` * `onInvalid` * `onSelect` +* `value` diff --git a/packages/react-strict-dom/src/types/StrictReactDOMOptionProps.js b/packages/react-strict-dom/src/types/StrictReactDOMOptionProps.js index 98c9277e..070e7888 100644 --- a/packages/react-strict-dom/src/types/StrictReactDOMOptionProps.js +++ b/packages/react-strict-dom/src/types/StrictReactDOMOptionProps.js @@ -13,6 +13,5 @@ export type StrictReactDOMOptionProps = $ReadOnly<{ ...StrictReactDOMProps, disabled?: ?boolean, label?: ?Stringish, - selected?: ?boolean, value?: ?Stringish }>; diff --git a/packages/react-strict-dom/src/types/StrictReactDOMSelectProps.js b/packages/react-strict-dom/src/types/StrictReactDOMSelectProps.js index 76754030..a3981b07 100644 --- a/packages/react-strict-dom/src/types/StrictReactDOMSelectProps.js +++ b/packages/react-strict-dom/src/types/StrictReactDOMSelectProps.js @@ -12,6 +12,7 @@ import type { AutoComplete, StrictReactDOMProps } from './StrictReactDOMProps'; export type StrictReactDOMSelectProps = $ReadOnly<{ ...StrictReactDOMProps, autoComplete?: AutoComplete, + defaultValue?: ?(Stringish | Array), multiple?: ?boolean, name?: ?string, required?: ?boolean, @@ -19,5 +20,6 @@ export type StrictReactDOMSelectProps = $ReadOnly<{ onChange?: $FlowFixMe, onInput?: $FlowFixMe, onInvalid?: $FlowFixMe, - onSelect?: $FlowFixMe + onSelect?: $FlowFixMe, + value?: ?(Stringish | Array) }>; diff --git a/packages/react-strict-dom/tests/__snapshots__/html-test.js.snap-dom b/packages/react-strict-dom/tests/__snapshots__/html-test.js.snap-dom index fa5bd896..deddcde5 100644 --- a/packages/react-strict-dom/tests/__snapshots__/html-test.js.snap-dom +++ b/packages/react-strict-dom/tests/__snapshots__/html-test.js.snap-dom @@ -5070,7 +5070,6 @@ exports[`html "option" supports inline event handlers 1`] = ` exports[`html "option" supports input attributes 1`] = `