Skip to content

Commit

Permalink
fix: hook call order
Browse files Browse the repository at this point in the history
  • Loading branch information
chrispader committed Nov 30, 2023
1 parent d0f4bfb commit 3051292
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/AddressSearch/CurrentLocationButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const defaultProps = {
};

function CurrentLocationButton({onPress, isDisabled}) {
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();
const {translate} = useLocalize();

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ function BaseAutoCompleteSuggestions<TSuggestion>(
}: AutoCompleteSuggestionsProps<TSuggestion>,
ref: ForwardedRef<View | HTMLDivElement>,
) {
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();
const rowHeight = useSharedValue(0);
const scrollRef = useRef<FlashList<TSuggestion>>(null);
/**
Expand Down
2 changes: 1 addition & 1 deletion src/components/Composer/index.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ const defaultProps = {

function Composer({shouldClear, onClear, isDisabled, maxLines, forwardedRef, isComposerFullSize, setIsFullComposerAvailable, ...props}) {
const textInput = useRef(null);
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();

/**
* Set the TextInput Ref
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmedRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ function ConfirmedRoute({mapboxAccessToken, transaction}) {
const {route0: route} = transaction.routes || {};
const waypoints = lodashGet(transaction, 'comment.waypoints', {});
const coordinates = lodashGet(route, 'geometry.coordinates', []);
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();

const getWaypointMarkers = useCallback(
(waypointsData) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/EmojiSuggestions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ type EmojiSuggestionsProps = {
const keyExtractor = (item: SimpleEmoji, index: number): string => `${item.name}+${index}}`;

function EmojiSuggestions({emojis, onSelect, prefix, isEmojiPickerLarge, preferredSkinToneIndex, highlightedEmojiIndex = 0, measureParentContainer = () => {}}: EmojiSuggestionsProps) {
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();
/**
* Render an emoji suggestion menu item component.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/GrowlNotification/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ function GrowlNotification(_, ref) {
const [bodyText, setBodyText] = useState('');
const [type, setType] = useState('success');
const [duration, setDuration] = useState();
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();

const types = {
[CONST.GROWL.SUCCESS]: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const propTypes = {
};

function MentionUserRenderer(props) {
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();
const {translate} = useLocalize();
const defaultRendererProps = _.omit(props, ['TDefaultRenderer', 'style']);
const htmlAttribAccountID = lodashGet(props.tnode.attributes, 'accountid');
Expand Down
2 changes: 1 addition & 1 deletion src/components/Picker/BasePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ const defaultProps = {
};

function BasePicker(props) {
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();

const [isHighlighted, setIsHighlighted] = useState(false);

Expand Down
2 changes: 1 addition & 1 deletion src/components/Reactions/EmojiReactionBubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const defaultProps = {
};

function EmojiReactionBubble(props) {
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();
return (
<PressableWithSecondaryInteraction
style={({hovered, pressed}) => [
Expand Down
2 changes: 1 addition & 1 deletion src/components/TabSelector/TabSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ const getOpacity = (position, routesLength, tabIndex, active, affectedTabs) => {

function TabSelector({state, navigation, onTabPress, position}) {
const {translate} = useLocalize();
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();
const defaultAffectedAnimatedTabs = useMemo(() => Array.from({length: state.routes.length}, (v, i) => i), [state.routes.length]);
const [affectedAnimatedTabs, setAffectedAnimatedTabs] = useState(defaultAffectedAnimatedTabs);

Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReactionList/HeaderReactionList.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const defaultProps = {
};

function HeaderReactionList(props) {
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();
return (
<View style={[styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.emojiReactionListHeader, !props.isSmallScreenWidth && styles.pt4]}>
<View style={styles.flexRow}>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/report/ReportActionItemSingle.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ const showWorkspaceDetails = (reportID) => {
};

function ReportActionItemSingle(props) {
const styles = useThemeStyles();
const theme = useTheme();
const styles = useThemeStyles();
const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT;
const actorAccountID = props.action.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW && props.iouReport ? props.iouReport.managerID : props.action.actorAccountID;
let displayName = ReportUtils.getDisplayNameForParticipant(actorAccountID);
Expand Down

0 comments on commit 3051292

Please sign in to comment.