@@ -27,7 +27,9 @@ RightResizable.propTypes = {...publicProps, ...anchoredProps, ...resizableProps}
2727export const Positioned : React . FC < IPublicProps & IResizableProps & IPositionedProps > = ( props ) => < SpaceInternal { ...props } />
2828RightResizable . propTypes = { ...publicProps , ...resizableProps , ...positionedProps } ;
2929
30- export const SpaceInternal : React . FC < AllProps > = ( props ) => {
30+ const USE_INLINESTYLES = false ;
31+
32+ export const SpaceInternal : React . FC < AllProps > = React . memo ( ( props ) => {
3133
3234 const divElementRef = React . useRef < HTMLDivElement > ( ) ;
3335
@@ -66,13 +68,14 @@ export const SpaceInternal : React.FC<AllProps> = (props) => {
6668 id : state . id ,
6769 ref : divElementRef ,
6870 className : outerClasses . join ( ' ' ) ,
71+ style : USE_INLINESTYLES ? { ...outerStyle , ...innerStyle } : undefined ,
6972 onClick : props . onClick ,
7073 onMouseDown : props . onMouseDown ,
7174 onMouseEnter : props . onMouseEnter ,
7275 onMouseLeave : props . onMouseLeave
7376 } ,
7477 < >
75- < HeadStyles id = { state . id } style = { outerStyle } />
78+ { ! USE_INLINESTYLES && < HeadStyles id = { state . id } style = { outerStyle } /> }
7679 { resizeHandle }
7780 < div
7881 className = { innerClasses . join ( ' ' ) }
@@ -87,14 +90,14 @@ export const SpaceInternal : React.FC<AllProps> = (props) => {
8790 id : state . id ,
8891 ref : divElementRef ,
8992 className : outerClasses . join ( ' ' ) ,
90- style : innerStyle ,
93+ style : USE_INLINESTYLES ? { ... innerStyle , ... outerStyle } : innerStyle ,
9194 onClick : props . onClick ,
9295 onMouseDown : props . onMouseDown ,
9396 onMouseEnter : props . onMouseEnter ,
9497 onMouseLeave : props . onMouseLeave
9598 } ,
9699 < >
97- < HeadStyles id = { state . id } style = { outerStyle } />
100+ { ! USE_INLINESTYLES && < HeadStyles id = { state . id } style = { outerStyle } /> }
98101 { resizeHandle }
99102 { children }
100103 </ >
@@ -103,7 +106,7 @@ export const SpaceInternal : React.FC<AllProps> = (props) => {
103106 </ SpaceInfoContext . Provider >
104107 </ SpaceContext . Provider >
105108 )
106- }
109+ } )
107110
108111const HeadStyles : React . FC < { id : string , style : React . CSSProperties } > = ( props ) => {
109112 const { style } = props ;
0 commit comments