Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

266
Views
React material ui snackbar siempre está en la parte inferior, ¿cómo puedo solucionarlo?

Hola, estoy tratando de crear un snackbar usando material ui. Reaccionar versión = 0.14 Material-ui versión = 0.15.0

No pude encontrar nada adecuado para esta versión de React, así que decidí usar material-ui. Funciona pero solo se abre en la parte inferior de la pantalla. ¿Cómo puedo cambiar esto? Por ejemplo, ¿cómo puedo obtener la parte superior derecha?

Mi código :

 import Snackbar from 'material-ui/Snackbar'; import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider' this.state = { open: false, }; handleTouchTap = () => { this.setState({ open: true, }); }; handleRequestClose = () => { this.setState({ open: false, }); }; <div> <button onClick={this.handleTouchTap}> SHOW NOTIFICATION <button> <Snackbar open={this.state.open} message="Event added to your calendar" autoHideDuration={4000} onRequestClose={this.handleRequestClose} /> </div>

La imagen está aquí: [Imagen de notificación 1

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Simplemente agregue anchorOrigin para actualizar la posición:

 <Snackbar ... anchorOrigin={{ vertical: 'top', horizontal: 'right' }} />
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!