title: How can i clear localStorage only avatar field when i upload avatar picture . React
body: <p>Hello everyone when i change avatar picture in my proje . I can upload successfuly but because of localStorage data is not changing. I tried like that ; </p>
  
  <pre><code>this.state = {
    imageUrl: props.user &amp;&amp; props.user.avatar,
  };
  </code></pre>
  
  <p>my function like that</p>
  
  <pre><code>changeAvatar() {
    const profileDetail = cloneDeep(JSON.parse(localStorage.getItem('__PERSISTED_STORE__')));
  
    const isProfileDetailExist = profileDetail
      &amp;&amp; profileDetail.user
      &amp;&amp; profileDetail.user.signIn
      &amp;&amp; profileDetail.user.info;
  
    if (isProfileDetailExist) {
      profileDetail.user.signIn.info.avatar = this.state.imageUrl;
    }
  
    localStorage.setItem('__PERSISTED_STORE__',
      JSON.stringify({
        user: profileDetail.user,
        language: profileDetail.language
      })
    );
  }
  </code></pre>
  
  <p>how can i do it . My data seems like; </p>
  
  <blockquote>
    <p>Preferences : {  user: { singIn: {info : { ..... avatar inside there .
    I want to change only avatar. language: ...</p>
  </blockquote>