score:2

Accepted answer

a possible solution is to create a state and after the property is saved, change that state, in order to the components (icon colors and image) re-render.

example for state:

const [success, setsucess] = usestate(false);

example for image:

const sucessimage = <img src="/images/index/newimage.png" alt="save" />;
const defaultimage = <img src="/images/index/save.png" alt="save" />;

    <div classname="saveaction">
                    {userid && 
                        <a onclick={saveclickproperty} classname="">
                            <div classname="actiondiv">
                                ${success ? sucessimage : defaultimage} {' '} save
                            </div>
                        </a>
                    }

                </div>

example of changing the state:

...
        }).then((resp) => {
            setsucess(true);
            console.log("hello");
            opennotification("", "property saved");

Related Query

More Query from same tag