my conponnent code is
export const AlertPanel: Component<{
successMsg: Accessor<string>;
errorMsg: Accessor<string>;
}> = ({ successMsg, errorMsg }) => {
const showError = () => errorMsg() != "";
const showSuccess = () => successMsg() != "";
createEffect(() => {
console.log(showError());
console.log(showSuccess());
});
return (
<>
<Banner type="error" opened={showError()}>
{errorMsg()}
</Banner>
<Banner type="success" opened={showSuccess()}>
{successMsg()}
</Banner>
</>
);
};
When the errorMsg changes, the showError does not change accordingly. Why is this happening?