-
-
Notifications
You must be signed in to change notification settings - Fork 170
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Hi, im trying to use a second window to make a file/folder picker (i didn't find anything, but is there a simpler way to do it? maybe some widget, or something from the os?), but i can't figure out if theres a way to close it from the javascript side (should close according to some user input), after watching this video https://youtu.be/8jH5gaEEDv4?t=1376 , i tried this:
function App() {
const [showWindow, setShowWindow] = useState(false);
const toggleWindow = () => {
setShowWindow(!showWindow);
};
return (
<>
<Window windowTitle="Hello 👋🏽" size={mainWindowSize}>
<View>
<Button text="Toggle Window" on={{ clicked: toggleWindow }}></Button>
</View>
</Window>
{showWindow && (
<Window
windowTitle="Second Window"
size={secondWindowSize}
>
<View>
<Text>Second Window</Text>
</View>
</Window>
)}
</>
);
}
but the second window doesn't close when showWindow is toggled to false, and when it is toggled to true, it opens another "Second Window".
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
