indexiatech / re-notif

Redux & React based Notifications center.
http://indexiatech.github.io/re-notif
BSD 3-Clause "New" or "Revised" License
148 stars 45 forks source link

Problem dispatching multiple notifications while one exists? #31

Closed rammoozz closed 8 years ago

rammoozz commented 8 years ago

I love your simple to use API, I implemented quickly but I am having trouble dispatching more than one notification while one exists (your demo seems to function). Thanks!

Update - I think it might be because I am not changing the state => no render => no new ID on notification, will try and report back.

warning.js?3efc:45 Warning: flattenChildren(...): Encountered two children with the same key,.$1468633431690. Child keys must be unique; when two children share a key, only the first child will be used.

The base of my folder structure - https://github.com/andrewdamelio/react-redux-boilerplate

My root Reducer
const rootReducer = combineReducers({
  notifs: notifReducer,
});
Container Component
function mapDispatchToProps(dispatch) {
  return {
    notifSend: (notification) => dispatch(notifSend(notification))
  };
}

Action dispatcher
const Nav = ({notifSend}) => {

...
   <a onClick={notifSend.bind(this,{message: 'hello world',
         kind: 'info',
         dismissAfter: 2000
       })}>Notification</a>
...
kylecesmat commented 8 years ago

@rkhayat were you able to handle this issue? Your solution should have solved the problem!