Skip to content

Commit

Permalink
fix: add material parameters to SegmentsProps
Browse files Browse the repository at this point in the history
  • Loading branch information
davidboy committed Nov 7, 2023
1 parent 1169c02 commit a2ca315
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,7 @@ type Props = {
/** Event callback when each frame changes */
onFrame?: Function
/** @deprecated Control when the animation runs*/
play?: boolean
play?: boolean
/** Control when the animation pauses */
pause?: boolean
/** Whether or not the Sprite should flip sides on the x-axis */
Expand Down Expand Up @@ -3234,7 +3234,12 @@ A wrapper around [THREE.LineSegments](https://threejs.org/docs/#api/en/objects/L
##### Prop based:

```jsx
<Segments limit={1000} lineWidth={1.0}>
<Segments
limit={1000}
lineWidth={1.0}
// All THREE.LineMaterial props are valid
{...materialProps}
>
<Segment start={[0, 0, 0]} end={[0, 10, 0]} color="red" />
<Segment start={[0, 0, 0]} end={[0, 10, 10]} color={[1, 0, 1]} />
</Segments>
Expand Down
4 changes: 2 additions & 2 deletions src/core/Segments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import * as THREE from 'three'
import * as React from 'react'
import mergeRefs from 'react-merge-refs'
import { extend, useFrame, ReactThreeFiber } from '@react-three/fiber'
import { Line2, LineSegmentsGeometry, LineMaterial } from 'three-stdlib'
import { Line2, LineSegmentsGeometry, LineMaterial, LineMaterialParameters } from 'three-stdlib'
import { ForwardRefComponent } from '../helpers/ts-utils'

type SegmentsProps = {
type SegmentsProps = LineMaterialParameters & {
limit?: number
lineWidth?: number
children: React.ReactNode
Expand Down

0 comments on commit a2ca315

Please sign in to comment.