-
Notifications
You must be signed in to change notification settings - Fork 688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Follow up #21 & #27 #29
Comments
I'm not sure if I'm misunderstanding, but I think you could use something like pick import pick from "lodash.pick";
import omit from "lodash.omit";
const props = {
showX: true,
position: [1,2,3]
};
const transformOnlyPropNames = ["showX", "enabled"];
const transformProps = pick(props, transformOnlyPropNames); // {showX: true}
const objectProps = omit(props, transformOnlyPropNames); // {position: Array[3]} https://codesandbox.io/s/magical-villani-zfzlo?file=/src/index.js:0-334 |
kevinresol
added a commit
to kevinresol/drei
that referenced
this issue
May 27, 2020
merged the pr, published, too |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For #27, Sorry the alternative destructure strategy is actually problematic:
because it now passes undefined values to the transform control, e.g.
enabled={undefined}
, orshowX={undefined}
, causing very weird errors. Not expert of TS, is there a way to not pass undefined props to the control?The text was updated successfully, but these errors were encountered: