Skip to content

Commit e94bcbe

Browse files
committed
Implement <svg> support
1 parent c8f9de8 commit e94bcbe

File tree

19 files changed

+2988
-38
lines changed

19 files changed

+2988
-38
lines changed

apps/examples/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"react": "~18.3.1",
1919
"react-dom": "~18.3.1",
2020
"react-native": "~0.76.1",
21+
"react-native-svg": "15.8.0",
2122
"react-native-web": "~0.19.13",
2223
"react-strict-dom": "*"
2324
},

package-lock.json

Lines changed: 63 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-strict-dom/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"peerDependencies": {
4545
"react": "^18.2.0",
4646
"react-dom": "^18.2.0",
47-
"react-native": ">=0.75.2"
47+
"react-native": ">=0.75.2",
48+
"react-native-svg": "^15.8.0"
4849
},
4950
"engines": {
5051
"node": ">=20.11.0"

packages/react-strict-dom/src/dom/html.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import type { StrictReactDOMListItemProps } from '../types/StrictReactDOMListIte
1717
import type { StrictReactDOMOptionProps } from '../types/StrictReactDOMOptionProps';
1818
import type { StrictReactDOMOptionGroupProps } from '../types/StrictReactDOMOptionGroupProps';
1919
import type { StrictReactDOMSelectProps } from '../types/StrictReactDOMSelectProps';
20+
import type { StrictReactDOMSvgProps } from '../types/StrictReactDOMSvgProps';
2021
import type { StrictReactDOMTextAreaProps } from '../types/StrictReactDOMTextAreaProps';
2122

2223
import { createStrictDOMComponent as createStrict } from './modules/createStrictDOMComponent';
@@ -373,6 +374,14 @@ export const sup: component(
373374
...StrictReactDOMProps
374375
) = createStrict('sup', defaultStyles.sup);
375376

377+
/**
378+
* "svg" (inline)
379+
*/
380+
export const svg: component(
381+
ref?: React.RefSetter<HTMLElement>,
382+
...StrictReactDOMSvgProps
383+
) = createStrict('svg', defaultStyles.img);
384+
376385
/**
377386
* "textarea" (inline-block)
378387
*/

packages/react-strict-dom/src/dom/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import type {
1616
} from '@stylexjs/stylex';
1717

1818
import * as html from './html';
19+
import * as svg from './svg';
1920
import * as css from '@stylexjs/stylex';
2021

2122
type StyleTheme<V, T> = Theme<V, T>;
@@ -25,4 +26,4 @@ type StylesWithout<T> = StyleXStylesWithout<T>;
2526

2627
export type { StaticStyles, StyleTheme, StyleVars, Styles, StylesWithout };
2728

28-
export { css, html };
29+
export { css, html, svg };

0 commit comments

Comments
 (0)