• H
    Fix with-context-api example (#8559) · aa406a1d
    Henrik Wenz 提交于
    ## Motivation
    
    The code before this PR had serveral issues:
    
    1. Context uses reference identity to determine when to re-render, there are some gotchas that could trigger unintentional renders in consumers when a provider’s parent re-renders.
    
    https://reactjs.org/docs/context.html#caveats
    
    2. `setState` should use the reducer pattern in this example to make sure clicks are not swallowed by react batch.
    aa406a1d
CounterProvider.js 886 字节