title: React leaflet center attribute does not change when the center state changes
body: <p><strong>App.js</strong></p>
  <pre class="lang-js prettyprint-override"><code>import { useState } from 'react';
  
  const App = () =&gt; {
    // This state is used to the center attribute of MapContainer component
    const [mapCenter, setMapCenter] = useState([34.80746, -40.4796]);
    // This state is used to the zoom attribute of MapContainer component
    const [mapZoom, setMapZoom] = useState(3);
  
    const onClickHandler = () =&gt; {
      setMapCenter([20, 100]);
      setMapZoom(5);
    };
  
    return (
      &lt;&gt;
        &lt;button onClick={onClickHandler}&gt;Change map's center location&lt;/button&gt;
        &lt;Map center={mapCenter} zoom={mapZoom} /&gt;
      &lt;/&gt;
    );
  };
  </code></pre>
  <p><strong>Map.js</strong></p>
  <pre class="lang-js prettyprint-override"><code>import React from 'react';
  import './Map.css';
  import { MapContainer, TileLayer } from 'react-leaflet';
  
  function Map({ center, zoom }) {
    return (
      &lt;div className=&quot;map&quot;&gt;
        &lt;MapContainer center={center} zoom={zoom}&gt;
          &lt;TileLayer
            url=&quot;https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png&quot;
            attribution='&amp;copy; &lt;a 
                  href=&quot;http://osm.org/copyright&quot;&gt;OpenStreetMap&lt;/a&gt; contributors'
          /&gt;
        &lt;/MapContainer&gt;
      &lt;/div&gt;
    );
  }
  
  export default Map;
  </code></pre>
  <p><strong>Map.css</strong></p>
  <pre class="lang-css prettyprint-override"><code>.map {
    height: 500px;
    background-color: white;
    padding: 1rem;
    border-radius: 20px;
    margin-top: 16px;
    box-shadow: 0 0 8px -4px rgba(0, 0, 0, 0.5);
  }
  
  .map .leaflet-container {
    height: 100%;
  }
  </code></pre>
  <p>When I clicks button, mapCenter state clearly changes to [20, 100] and mapZoom also changes to 5. But in the Map Component Map does not show new center. but I don't know why. I already checked state's change.
  Map never respond. Does anyone knows??? Please answer a way to figure it out.</p>