File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 1.9.1 (September XX, 2023)
1+ 1.9.1 (October XX, 2023)
2+ - Updated type definitions of the library components to not restrict the type of the `children` prop to ReactElement, allowing to pass any valid ReactNode value (Related to issue https://github.com/splitio/react-client/issues/164).
23 - Updated linter and other dependencies for vulnerability fixes.
34
451.9.0 (July 18, 2023)
Original file line number Diff line number Diff line change 11import SplitIO from '@splitsoftware/splitio/types/splitio' ;
2+ import type { ReactNode } from 'react' ;
23
34/**
45 * Split Status interface. It represents the current readiness state of the SDK.
@@ -124,7 +125,7 @@ export interface ISplitFactoryProps extends IUpdateProps {
124125 /**
125126 * Children of the SplitFactory component. It can be a functional component (child as a function) or a React element.
126127 */
127- children : ( ( props : ISplitFactoryChildProps ) => JSX . Element | null ) | JSX . Element | null ;
128+ children : ( ( props : ISplitFactoryChildProps ) => ReactNode ) | ReactNode ;
128129}
129130
130131/**
@@ -159,7 +160,7 @@ export interface ISplitClientProps extends IUpdateProps {
159160 /**
160161 * Children of the SplitFactory component. It can be a functional component (child as a function) or a React element.
161162 */
162- children : ( ( props : ISplitClientChildProps ) => JSX . Element | null ) | JSX . Element | null ;
163+ children : ( ( props : ISplitClientChildProps ) => ReactNode ) | ReactNode ;
163164}
164165
165166/**
@@ -197,5 +198,5 @@ export interface ISplitTreatmentsProps {
197198 /**
198199 * Children of the SplitTreatments component. It must be a functional component (child as a function) you want to show.
199200 */
200- children : ( ( props : ISplitTreatmentsChildProps ) => JSX . Element | null ) ;
201+ children : ( ( props : ISplitTreatmentsChildProps ) => ReactNode ) ;
201202}
Original file line number Diff line number Diff line change 1- /// <reference types="react" />
21import SplitIO from '@splitsoftware/splitio/types/splitio' ;
2+ import type { ReactNode } from 'react' ;
33/**
44 * Split Status interface. It represents the current readiness state of the SDK.
55 */
@@ -103,7 +103,7 @@ export interface ISplitFactoryProps extends IUpdateProps {
103103 /**
104104 * Children of the SplitFactory component. It can be a functional component (child as a function) or a React element.
105105 */
106- children : ( ( props : ISplitFactoryChildProps ) => JSX . Element | null ) | JSX . Element | null ;
106+ children : ( ( props : ISplitFactoryChildProps ) => ReactNode ) | ReactNode ;
107107}
108108/**
109109 * SplitClient Child Props interface. These are the props that the child component receives from the 'SplitClient' component.
@@ -131,7 +131,7 @@ export interface ISplitClientProps extends IUpdateProps {
131131 /**
132132 * Children of the SplitFactory component. It can be a functional component (child as a function) or a React element.
133133 */
134- children : ( ( props : ISplitClientChildProps ) => JSX . Element | null ) | JSX . Element | null ;
134+ children : ( ( props : ISplitClientChildProps ) => ReactNode ) | ReactNode ;
135135}
136136/**
137137 * SplitTreatments Child Props interface. These are the props that the child component receives from the 'SplitTreatments' component.
@@ -163,6 +163,6 @@ export interface ISplitTreatmentsProps {
163163 /**
164164 * Children of the SplitTreatments component. It must be a functional component (child as a function) you want to show.
165165 */
166- children : ( ( props : ISplitTreatmentsChildProps ) => JSX . Element | null ) ;
166+ children : ( ( props : ISplitTreatmentsChildProps ) => ReactNode ) ;
167167}
168168export { } ;
You can’t perform that action at this time.
0 commit comments