Skip to content
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

fix: add material parameters to SegmentsProps #1708

Conversation

davidboy
Copy link
Contributor

@davidboy davidboy commented Nov 7, 2023

Why

The Segments component currently passes on any unrecognized props to its LineMaterial, but the type definition for SegmentsProps does not allow any such parameters to be supplied.

type SegmentsProps = {
limit?: number
lineWidth?: number
children: React.ReactNode
}

<primitive
object={material}
attach="material"
vertexColors={true}
resolution={resolution}
linewidth={lineWidth}
{...rest}
/>

The {...rest} spreading was presumably added for a reason, but it is currently impossible to take advantage of. I ran into this issue when attempting to create dashed segments.

What

This pull request modifies the type definition of SegmentsProps to allow LineMaterialParameters to be passed through to the underlying line material, which I believe was the original intent.

I updated README.md following the example of how other components which pass through material parameters are documented.

Checklist

  • Documentation updated (example)
  • Ready to be merged

Copy link

vercel bot commented Nov 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 7, 2023 5:41am

Copy link

codesandbox-ci bot commented Nov 7, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit a2ca315:

Sandbox Source
nice-grass-2cctgl Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

@CodyJasonBennett CodyJasonBennett merged commit 3a3e3ec into pmndrs:master Nov 10, 2023
2 checks passed
Copy link

🎉 This PR is included in version 9.88.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants