score:2
Accepted answer
dialogcontent does not have a prop display. that is why you see both, because it is just ignored. you should change displaysignin and displaysignup to be a boolean and use a ternary operator like this:
{displaysignin && <dialogcontent component="div">
<dialogcontenttext>
sign in
<button color="inherit" onclick={togglesignup}>sign up</button>
</dialogcontenttext>
</dialogcontent>}
{displaysignup && <dialogcontent component="div">
<dialogcontenttext>
sign up
<button color="inherit" onclick={togglesignin}>sign in</button>
</dialogcontenttext>
</dialogcontent>}
to toggle between these two states.
Source: stackoverflow.com
Related Query
- Material dialog showing despite display="none"
- How to submit the form by Material UI Dialog using ReactJS
- How to add close icon in Material UI Dialog Header top right corner
- Material UI Tooltip Stays Open after triggered Dialog is closed
- Material UI tooltip doesn't display on custom component, despite spreading props to that component
- react-hook-form's setValue method is not working if input is in material ui dialog
- Full text is not showing in alert dialog in react native
- Dispatch a Redux action with the subsequent action as payload to show a snackbar or dialog of Material UI
- Material UI DatePicker Showing Wrong Date
- React Material Tabs indicator not showing on first load
- Open "choose file" dialog box on onclick of Raised Button Material ui
- Test a onClose callback from dialog when using material UI & react testing library?
- How do I prevent Material UI Dialog from being dismissed upon clicking the backdrop?
- How to target backdrop color property of Material UI Dialog using styled components?
- Prevent event propagation on row click and dialog in material ui
- CKEditor 4 having problem when used in Material UI dialog
- Can't remove scrollbar from Material UI Dialog
- Material UI select not showing label
- Pressing tab key closes Material UI Dialog that is opened from a submenu
- Simple Material UI dialog example has unwanted scrollbar
- React scroll on dialog material ui
- How to make Material UI v1.0 Dialog background transparent?
- Unit testing React component using Material UI Dialog
- material ui next dialog textfield underline color
- Form in Material UI Dialog using React
- Material UI Dialog turned to Hook flickering
- Material UI Autocomplete component not showing values from react state
- Material UI <IconButton> not showing
- Material Dialog scrolls body to top on open
- Material UI TextField Not Showing Value
More Query from same tag
- Redux: Asynchronous action creator not being called
- React Hooks: Instantiating state hooks on validation Error: Invalid hook call. Hooks can only be called inside of the body of a function component
- React "Each child in the list should have a unique 'key' prop"
- How to render an element when form.isFieldsTouched() changes
- Why am I getting Uncaught ReferenceError: React is not defined?
- React Fetch Google API
- How to connect MySQL database to ReactJS app?
- When are the props `propName` and `componentName` passed to the `PropTypes` functions?
- How do I edit events in "react-big-calendars"
- Complex layout using React and CSS Grid
- keep user logged in when browser closes, not when it refreshes
- Unable to export 2 Higher Order Components from one JS file in ReactJS
- how can I extend material ui theme type and modify existing types in Typescript?
- React-final-form focus doesn't focus on given field
- Handle multiple input boxes rendered using map function javascript
- Production URL for nextjs
- Am i promise chaining correctly?
- Variables within class?
- Can't get MobX, TypeScript, React and actions to work
- Trying to map an array of objects in react
- TypeScript React Google Maps: 'google' does not exist
- Test React confirmation window using enzyme
- React - How to update the state in useEffect without causing an infinite loop?
- How do you do conditional hovering in styled components?
- How to set HTML lang attribute dynamically on NextJs Document?
- Running React & Express in Docker without exposing multiple Ports
- How to integrate React js along with Laravel 8?
- SWR hook not reflecting database change
- Use string from prop to import and display a component
- ReactJS: Using rgba in box-shadow with styled-components props not working