diff --git a/app/javascript/mastodon/components/column_back_button.jsx b/app/javascript/mastodon/components/column_back_button.jsx
deleted file mode 100644
index 3e914ecad..000000000
--- a/app/javascript/mastodon/components/column_back_button.jsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import PropTypes from 'prop-types';
-import { PureComponent } from 'react';
-import { createPortal } from 'react-dom';
-
-import { FormattedMessage } from 'react-intl';
-
-import { withRouter } from 'react-router-dom';
-
-import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg';
-
-import { Icon } from 'mastodon/components/icon';
-import { WithRouterPropTypes } from 'mastodon/utils/react_router';
-
-export class ColumnBackButton extends PureComponent {
-
- static propTypes = {
- multiColumn: PropTypes.bool,
- onClick: PropTypes.func,
- ...WithRouterPropTypes,
- };
-
- handleClick = () => {
- const { onClick, history } = this.props;
-
- if (onClick) {
- onClick();
- } else if (history.location?.state?.fromMastodon) {
- history.goBack();
- } else {
- history.push('/');
- }
- };
-
- render () {
- const { multiColumn } = this.props;
-
- const component = (
-
- );
-
- if (multiColumn) {
- return component;
- } else {
- // The portal container and the component may be rendered to the DOM in
- // the same React render pass, so the container might not be available at
- // the time `render()` is called.
- const container = document.getElementById('tabs-bar__portal');
- if (container === null) {
- // The container wasn't available, force a re-render so that the
- // component can eventually be inserted in the container and not scroll
- // with the rest of the area.
- this.forceUpdate();
- return component;
- } else {
- return createPortal(component, container);
- }
- }
- }
-
-}
-
-export default withRouter(ColumnBackButton);
diff --git a/app/javascript/mastodon/components/column_back_button.tsx b/app/javascript/mastodon/components/column_back_button.tsx
new file mode 100644
index 000000000..965edc8dc
--- /dev/null
+++ b/app/javascript/mastodon/components/column_back_button.tsx
@@ -0,0 +1,70 @@
+import { useCallback } from 'react';
+
+import { FormattedMessage } from 'react-intl';
+
+import { ReactComponent as ArrowBackIcon } from '@material-symbols/svg-600/outlined/arrow_back.svg';
+
+import { Icon } from 'mastodon/components/icon';
+import { ButtonInTabsBar } from 'mastodon/features/ui/util/columns_context';
+
+import { useAppHistory } from './router';
+
+type OnClickCallback = () => void;
+
+function useHandleClick(onClick?: OnClickCallback) {
+ const history = useAppHistory();
+
+ return useCallback(() => {
+ if (onClick) {
+ onClick();
+ } else if (history.location.state?.fromMastodon) {
+ history.goBack();
+ } else {
+ history.push('/');
+ }
+ }, [history, onClick]);
+}
+
+export const ColumnBackButton: React.FC<{ onClick: OnClickCallback }> = ({
+ onClick,
+}) => {
+ const handleClick = useHandleClick(onClick);
+
+ const component = (
+
+ );
+
+ return