@@ -76,15 +76,15 @@ export const useConfig: DataStateConstructor = <T, A extends any[], R>(config: F
7676 }
7777
7878 const Render = < K extends keyof T > ( conf : RenderConfig < T , K > = { } ) : ReactNode => {
79- const { valueCallback, field, staticString , error, loadingMessage, loadingPulseColor,
79+ const { valueCallback, field, staticContent , error, loadingMessage, loadingPulseColor,
8080 showFallback = true , loadingFallback, errorFallback, jointClass } = conf ;
8181
8282 switch ( dataRoot . status ) {
8383 case 'loading' :
8484 if ( showFallback ) {
8585 if ( loadingFallback ) return loadingFallback ;
8686 else if ( loadingMessage ) return < LoadingIndicator message = { loadingMessage } className = { jointClass } /> ;
87- else return < LoadingPulse loadingPulseColor = { loadingPulseColor } className = { jointClass } content = { staticString } /> ;
87+ else return < LoadingPulse loadingPulseColor = { loadingPulseColor } className = { jointClass } content = { staticContent } /> ;
8888 } return ;
8989 case 'value' :
9090 if ( valueCallback ) {
@@ -105,15 +105,15 @@ export const useConfig: DataStateConstructor = <T, A extends any[], R>(config: F
105105 return value ;
106106 } else if ( field ) {
107107 return < span className = { jointClass } > { String ( dataRoot . value [ field ] ) } </ span > ;
108- } else if ( staticString ) {
109- return < span className = { jointClass } > { staticString } </ span > ;
108+ } else if ( staticContent ) {
109+ return < span className = { jointClass } > { staticContent } </ span > ;
110110 } else return < span className = { jointClass } > { String ( dataRoot . value ) } </ span > ;
111111 case 'error' :
112- // When only the staticString prop was provided for the Render function,
113- // the staticString should be displayed regardless of possible errors,
114- // since the errors have nothing to do with the static string to display :
115- if ( ! valueCallback && ! field && staticString ) {
116- return < span className = { jointClass } > { staticString } </ span > ;
112+ // When only the staticContent prop was provided for the Render function,
113+ // the staticContent should be displayed regardless of possible errors,
114+ // since the errors have nothing to do with the static content to be displayed :
115+ if ( ! valueCallback && ! field && staticContent ) {
116+ return < span className = { jointClass } > { staticContent } </ span > ;
117117 }
118118 else if ( showFallback ) {
119119 return errorFallback ?? < ErrorIndicator refetch = { fetch } error = { error } className = { jointClass } /> ;
0 commit comments