const user = {
username: "Some username",
password: "s0m3 p4ssw0rd",
vitalSecretInfo: "..."
};
function RevealInfo(
{ username, password, vitalSecretInfo }:
{ username: string; password?: string; vitalSecretInfo: string }
) {
...
}
const SafeRevealInfo = withPick(["username"])(RevealInfo);
<SafeRevealInfo {...user} />
// is equivalent to
<RevealInfo username={user.username} /> // password and vitalSecretInfo is not included
Generated using TypeDoc
Pick, which is actually ignore other props