I’m using Shopify Polaris SaveBar in a Remix app and having issues with programmatically hiding it.
My code:
import { SaveBar, useAppBridge } from “@shopify/app-bridge-react”;
export default function MyComponent() {
const shopify = useAppBridge();
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
// Effect to show/hide SaveBar
useEffect(() => {
if (hasUnsavedChanges) {
shopify.saveBar.show(‘my-save-bar’);
} else {
shopify.saveBar.hide(‘my-save-bar’);
}
}, [hasUnsavedChanges, shopify]);
return (
);
}The logs show that hasUnsavedChanges correctly changes from true to false, and shopify.saveBar.hide() is being called, but the SaveBar remains visible on screen.
Console output: