const user = {
username: "Some username",
password: "s0m3 p4ssw0rd",
vitalSecretInfo: "..."
};
function RevealInfo(
{ username, password, vitalSecretInfo }:
{ username: string; password?: string; vitalSecretInfo: string }
) {
...
}
const SafeRevealInfo = withOmit(["password"])(RevealInfo);
<SafeRevealInfo {...user} />
// is equivalent to
<RevealInfo username={user.username} vitalSecretInfo={user.vitalSecretInfo} /> // password is not included, but you can still see vitalSecretInfo
Generated using TypeDoc
Omit, which is actually ignore mentioned props