Skip to content

Commit

Permalink
update react 18.3 check
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnMarieW committed Feb 4, 2025
1 parent 70aefe3 commit f5938b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ts/utils/dash3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const isDash3 = (): boolean => {
export const setPersistence = (Component: any, props: string[] = ["value"]): void => {
const persistence = { persisted_props: props, persistence_type: "local" };

if (parseFloat(React.version) < 18.3) {
if if (parseFloat(React.version.substring(0, React.version.lastIndexOf('.'))) < 18.3) {
Component.defaultProps = persistence;
} else {
Component.dashPersistence = persistence;
Expand Down

0 comments on commit f5938b9

Please sign in to comment.