I have the following component:
import { useBodyCreateUser } from "../jotai/bodyCreateUser";
const Header = ({
  noVerify,
  name,
  processed,
  OnProcessed,
}: any) => (
  <View style={styles.container}>
    <View style={styles.controls}>
      <HorizontalSpacer />
      <Text style={{ ...styles.textForm }}>NAME</Text>
      <Text style={styles.textInput}>{name}</Text>
      {noVerify ? (
        <View style={{ width: "100%" }}>
          
          {processed == false && (
            <GreenButtonText onPress={OnProcessed}>
              <Text style={stylesButtons.text}>Set to Processed</Text>
            </GreenButtonText>
          )}
        </View>
      ) : (
        <View style={{ width: "100%", paddingTop: "45%" }}>
          // ** other code here ** //
        </View>
      )}
  </View>
);
export default function Settings({ navigation }: RootTabScreenProps<any>) {
const [getBody, setBodyCreateUser] = useBodyCreateUser();
const [verify, setVerify] = React.useState(false);
return (
 <SafeAreaView style={styles.container}>
<Header
            noVerify={verify}
            name={name}
            
            processed={getBody.processed}
            OnProcessed={() => {
             
                  getBody.processed = true;
                  setBodyCreateUser(getBody);
                  // update local storage
                  AsyncStorage.setItem("appstate", JSON.stringify(getBody));
              
            }} 
           
          />
 </SafeAreaView>
);
};
When I click the button "Set to Processed" I need the button to hide. It works when I go back to the previous screen after I set it to processed and then enter it again into the view. But in the same view when the OnProcessed event happens the button still there?
I don't know if there is a way to reload or refresh the Header component, but I thought that by just setting the property processed to true that will reflect the change but is not.
Any clue?
 
    