Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

208
Visualizações
React/redux notifications

I'm working on a react/redux project. I looking for a component or a package, that displays notification messages to the user, for example react-notify.

The components I've found (including react-notify) use refs:

<ReactNotify ref='notificator'/>

I want a package without refs, if one exists.

Thank you!

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Look at redux-notifications. It's a pure redux solution without the use of refs. The documentation is a bit outdated, but this worked for me (the change is the actions).

You add the <Notifs /> component to the root of your project:

import { Provider }  from 'react-redux'
import { Notifs } from 'redux-notifications';

<Provider store={store}>
  <div>
    // ... other things like router ...
    <Notifs />
  </div>
</Provider>

Add the the notifReducer to your base reducer:

import { createStore, combineReducers } from 'redux'
import { reducer as notifReducer } from 'redux-notifications';
combineReducers({
  notifs: notifReducer,
  // ... more reducers here ...
})

And then use the built in actions to dispatch notifications:

import { actions } from 'redux-notifications';

action.notifSend({
    message: "I am a notification",
    kind,
    id: 1234,
    dismissAfter: 2000
})(dispatch)
over 4 years ago · Santiago Trujillo Relatório

0

I have recently developed a simple library to implement a react-redux notification system on your app and it doesn't need to use ref. Check it out react-redux-notifications. Any feedback would be appreciate it.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda