SolidJSS
SolidJSโ€ข3y agoโ€ข
4 replies
baxuz

splitProps instead of destructuring?

How does splitProps work exactly?

export const ResultDisplay: Component<{ result: Result }> = (props) => {
  const [res] = splitProps(props, ["result"]);


In this case it's absolutely the same if I write splitProps(props, ["result"]); or splitProps(props, []);.

I just get props. I know I can use:
const result = () => props.result;


But I'm not sure how splitProps works.
Was this page helpful?