mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
Allow 'styleName' for SVG elements via react module augment (#16004)
This commit is contained in:
committed by
Sheetal Nandi
parent
df38f202a0
commit
e44c291ab7
Vendored
+4
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for react-css-modules 3.7.9
|
||||
// Type definitions for react-css-modules 4.2.0
|
||||
// Project: https://github.com/gajus/react-css-modules
|
||||
// Definitions by: Kostya Esmukov <https://github.com/KostyaEsmukov>, Tadas Dailyda <https://github.com/skirsdeda>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -33,4 +33,7 @@ declare module 'react' {
|
||||
interface HTMLAttributes<T> {
|
||||
styleName?: string;
|
||||
}
|
||||
interface SVGAttributes<T> {
|
||||
styleName?: string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,3 +41,23 @@ class TableDecorated extends React.Component<TableDecoratedProps, {}> {
|
||||
</div>;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface TableProps extends CSSModules.InjectedCSSModuleProps {
|
||||
|
||||
}
|
||||
|
||||
class Svg extends React.Component<TableProps, {}> {
|
||||
render () {
|
||||
const { styles } = this.props;
|
||||
|
||||
return <svg styleName='table'>
|
||||
<g styleName='row'>
|
||||
<rect styleName='cell' />
|
||||
<rect styleName='cell' />
|
||||
</g>
|
||||
</svg>;
|
||||
}
|
||||
}
|
||||
|
||||
const SvgHOC = CSSModules(Svg, styles);
|
||||
|
||||
Reference in New Issue
Block a user