@@ -50,7 +50,6 @@ import {
5050} from '@jsonforms/core' ;
5151import { isEqual } from 'lodash' ;
5252import Enzyme , { mount , shallow } from 'enzyme' ;
53- import type { StatelessRenderer } from '../../src/Renderer' ;
5453import Adapter from '@wojtekmaj/enzyme-adapter-react-17' ;
5554import {
5655 JsonForms ,
@@ -114,13 +113,13 @@ export const initJsonFormsStore = ({
114113 return createStore ( reducer , initState ) ;
115114} ;
116115
117- const CustomRenderer1 : StatelessRenderer < RendererProps > = ( ) => < h1 > test</ h1 > ;
118- const CustomRenderer2 : StatelessRenderer < RendererProps > = ( ) => < h2 > test</ h2 > ;
119- const CustomRenderer3 : StatelessRenderer < RendererProps > = ( ) => < h3 > test</ h3 > ;
120- const CellRenderer1 : StatelessRenderer < DispatchCellProps > = ( ) => (
116+ const CustomRenderer1 : React . FC < RendererProps > = ( ) => < h1 > test</ h1 > ;
117+ const CustomRenderer2 : React . FC < RendererProps > = ( ) => < h2 > test</ h2 > ;
118+ const CustomRenderer3 : React . FC < RendererProps > = ( ) => < h3 > test</ h3 > ;
119+ const CellRenderer1 : React . FC < DispatchCellProps > = ( ) => (
121120 < h1 className = 'cell test 1' > test</ h1 >
122121) ;
123- const CellRenderer2 : StatelessRenderer < DispatchCellProps > = ( ) => (
122+ const CellRenderer2 : React . FC < DispatchCellProps > = ( ) => (
124123 < h2 className = 'cell test 2' > test</ h2 >
125124) ;
126125
@@ -256,7 +255,7 @@ test('ids should be unique within the same form', () => {
256255 } ) ;
257256
258257 const ids : string [ ] = [ ] ;
259- const MyCustomRenderer : StatelessRenderer < any > = ( props : any ) => {
258+ const MyCustomRenderer : React . FC < any > = ( props : any ) => {
260259 ids . push ( props . id ) ;
261260 return < div > Custom</ div > ;
262261 } ;
@@ -432,9 +431,7 @@ test('JsonForms renderer should pick most applicable cell renderer via ownProps'
432431 } ) ;
433432 store . dispatch ( registerCell ( ( ) => 50 , CellRenderer1 ) ) ;
434433
435- const ArrayRenderer : StatelessRenderer < RendererProps > = (
436- props : RendererProps
437- ) => {
434+ const ArrayRenderer : React . FC < RendererProps > = ( props : RendererProps ) => {
438435 return (
439436 < DispatchCell
440437 schema = { props . schema }
@@ -555,9 +552,7 @@ test('JsonForms renderer should pick schema from ownProps', () => {
555552} ) ;
556553
557554test ( 'JsonForms renderer should pick enabled prop from ownProps' , ( ) => {
558- const CustomRenderer4 : StatelessRenderer < RendererProps > = (
559- props : RendererProps
560- ) => {
555+ const CustomRenderer4 : React . FC < RendererProps > = ( props : RendererProps ) => {
561556 return < h3 > { `${ props . enabled } ` } </ h3 > ;
562557 } ;
563558
@@ -1010,7 +1005,7 @@ test('JsonForms should update if data prop is updated', () => {
10101005} ) ;
10111006
10121007test ( 'JsonForms should use additionalErrors if provided' , ( ) => {
1013- const CustomRendererWithError : StatelessRenderer < ControlProps > = ( {
1008+ const CustomRendererWithError : React . FC < ControlProps > = ( {
10141009 errors,
10151010 } : ControlProps ) => {
10161011 return < h5 > { errors } </ h5 > ;
@@ -1048,7 +1043,7 @@ test('JsonForms should use additionalErrors if provided', () => {
10481043} ) ;
10491044
10501045test ( 'JsonForms should use react to additionalErrors update' , ( ) => {
1051- const CustomRendererWithError : StatelessRenderer < ControlProps > = ( {
1046+ const CustomRendererWithError : React . FC < ControlProps > = ( {
10521047 errors,
10531048 } : ControlProps ) => {
10541049 return < h5 > { errors } </ h5 > ;
0 commit comments