Raigecki / BulletJournal

Progressive Web App + iOS App that replicates the design and functionality of bullet journals with React.js
2 stars 0 forks source link

Clicking on a checkbox throws 'Cannot read property 'dispatch' of undefined' error #3

Closed icsd01 closed 4 years ago

icsd01 commented 4 years ago

image

Raigecki commented 4 years ago

This issue might require a whole restructuring of components Inside Bullets.js:

import {BulletsContext} from './DayView'
import {BulletsContext} from './WeekView'

 <input 
     type="text"
     value={state.text}
     onChange={e => {
     setState({...state, text: e.target.value})                       
        bulletsContext.dispatch({
           type:'save', id: props.bullet.id, bullet: state 
        })                 
     }}
 />
Raigecki commented 4 years ago

Fixed with commit 16ae6085623c70e679f09b5fb98d55096d2184bd