Skip to content

Commit

Permalink
Merge pull request #31546 from software-mansion-labs/ts-migration/upd…
Browse files Browse the repository at this point in the history
…ate-props-worklet-lib

[TS migration] Migrate 'updatePropsPaperWorklet' lib to TypeScript
  • Loading branch information
mountiny authored Jan 5, 2024
2 parents c6bbff1 + b636a39 commit 30061bd
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
3 changes: 0 additions & 3 deletions src/libs/updatePropsPaperWorklet/index.js

This file was deleted.

13 changes: 0 additions & 13 deletions src/libs/updatePropsPaperWorklet/index.native.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
import React, {useCallback, useEffect, useMemo, useRef, useState} from 'react';
import {View} from 'react-native';
import {withOnyx} from 'react-native-onyx';
import {runOnJS, useAnimatedRef} from 'react-native-reanimated';
import {runOnJS, setNativeProps, useAnimatedRef} from 'react-native-reanimated';
import _ from 'underscore';
import AttachmentModal from '@components/AttachmentModal';
import EmojiPickerButton from '@components/EmojiPicker/EmojiPickerButton';
Expand All @@ -24,7 +24,6 @@ import getDraftComment from '@libs/ComposerUtils/getDraftComment';
import * as DeviceCapabilities from '@libs/DeviceCapabilities';
import getModalState from '@libs/getModalState';
import * as ReportUtils from '@libs/ReportUtils';
import updatePropsPaperWorklet from '@libs/updatePropsPaperWorklet';
import willBlurTextInputOnTapOutsideFunc from '@libs/willBlurTextInputOnTapOutside';
import ParticipantLocalTime from '@pages/home/report/ParticipantLocalTime';
import reportActionPropTypes from '@pages/home/report/reportActionPropTypes';
Expand Down Expand Up @@ -348,13 +347,10 @@ function ReportActionCompose({
return;
}

const viewTag = animatedRef();
const viewName = 'RCTMultilineTextInputView';
const updates = {text: ''};
// We are setting the isCommentEmpty flag to true so the status of it will be in sync of the native text input state
runOnJS(setIsCommentEmpty)(true);
runOnJS(resetFullComposerSize)();
updatePropsPaperWorklet(viewTag, viewName, updates); // clears native text input on the UI thread
setNativeProps(animatedRef, {text: ''}); // clears native text input on the UI thread
runOnJS(submitForm)();
}, [isSendDisabled, resetFullComposerSize, submitForm, animatedRef, isReportReadyForDisplay]);

Expand Down

0 comments on commit 30061bd

Please sign in to comment.