File tree 1 file changed +6
-1
lines changed 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import { Tooltip } from '~/src';
14
14
const reactElementToJSXStringOptions : Options = {
15
15
filterProps : [ 'key' , 'ref' ] ,
16
16
showFunctions : true ,
17
- sortProps : true ,
17
+ useBooleanShorthandSyntax : false ,
18
18
} ;
19
19
20
20
interface CodePreviewProps extends PropsWithChildren , ComponentProps < 'div' > {
@@ -62,6 +62,7 @@ export const CodePreview: FC<CodePreviewProps> = ({
62
62
code = deleteJSXSpaces ( code ) ;
63
63
code = deleteSVGs ( code ) ;
64
64
code = replaceWebpackImportsOnFunctions ( code ) ;
65
+ code = explicitTruthyPropsToShorthandSyntax ( code ) ;
65
66
code = `'use client';
66
67
67
68
import { ${ importFlowbiteReact ?? firstComponentDisplayName ( code ) } } from 'flowbite-react';
@@ -231,3 +232,7 @@ const slugToUpperCamelCase = (str: string) => {
231
232
. replaceAll ( / \b [ a - z ] / g, ( letter ) => letter . toUpperCase ( ) )
232
233
. replaceAll ( / \s / g, '' ) ;
233
234
} ;
235
+
236
+ const explicitTruthyPropsToShorthandSyntax = ( str : string ) => {
237
+ return str . replaceAll ( / = { true} / g, '' ) ;
238
+ } ;
You can’t perform that action at this time.
0 commit comments