Skip to content

Commit

Permalink
fix: uses of ComponentInternals
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Apr 5, 2024
1 parent a0ee4ab commit b3febb2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/icons/lucide/react/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ async function main() {
const svg = raw.toString()
const code = `
/* eslint-disable no-shadow-restricted-names */
import { Icon, ComponentInternals } from "@react-three/uikit";
import { Icon, ComponentInternals, IconProperties } from "@react-three/uikit";
import { ComponentPropsWithoutRef, forwardRef } from "react";
export type ${name}Props = Omit<ComponentPropsWithoutRef<typeof Icon>, "text" | "svgWidth" | "svgHeight">;
const text = \`${svg}\`;
export const ${name} = /*@__PURE__*/ forwardRef<ComponentInternals, ${name}Props>((props, ref) => {
export const ${name} = /*@__PURE__*/ forwardRef<ComponentInternals<IconProperties>, ${name}Props>((props, ref) => {
return <Icon {...props} ref={ref} text={text} svgWidth={24} svgHeight={24} />
})
`
Expand Down
4 changes: 2 additions & 2 deletions packages/kits/apfel/slider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ThreeEvent } from '@react-three/fiber'
import type { EventHandlers } from '@react-three/fiber/dist/declarations/src/core/events'
import { ComponentInternals, Container, DefaultProperties } from '@react-three/uikit'
import { ComponentInternals, Container, ContainerProperties, DefaultProperties } from '@react-three/uikit'
import React, { ComponentPropsWithoutRef, ReactNode, useMemo, useRef, useState } from 'react'
import { Vector3 } from 'three'
import { clamp } from 'three/src/math/MathUtils.js'
Expand Down Expand Up @@ -41,7 +41,7 @@ export function Slider({
}) {
const [uncontrolled, setUncontrolled] = useState(defaultValue)
const value = providedValue ?? uncontrolled ?? 50
const ref = useRef<ComponentInternals>(null)
const ref = useRef<ComponentInternals<ContainerProperties>>(null)
const onChange = useRef(onValueChange)
onChange.current = onValueChange
const hasProvidedValue = providedValue != null
Expand Down
4 changes: 2 additions & 2 deletions packages/kits/default/slider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Container, ComponentInternals } from '@react-three/uikit'
import { Container, ComponentInternals, ContainerProperties } from '@react-three/uikit'
import { colors } from './theme'
import React, { ComponentPropsWithoutRef, useMemo, useRef, useState } from 'react'
import { EventHandlers, ThreeEvent } from '@react-three/fiber/dist/declarations/src/core/events.js'
Expand Down Expand Up @@ -28,7 +28,7 @@ export function Slider({
const value = providedValue ?? uncontrolled ?? 50
const range = max - min
const percentage = `${(100 * value) / range}%` as const
const ref = useRef<ComponentInternals>(null)
const ref = useRef<ComponentInternals<ContainerProperties>>(null)
const onChange = useRef(onValueChange)
onChange.current = onValueChange
const hasProvidedValue = providedValue != null
Expand Down
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"scripts": {
"build": "tsc",
"check:prettier": "prettier --check src scripts tests",
"check:prettier": "prettier --check src",
"check:eslint": "eslint 'src/**/*.{tsx,ts}'",
"fix:prettier": "prettier --write src",
"fix:eslint": "eslint 'src/**/*.{tsx,ts}' --fix"
Expand Down

0 comments on commit b3febb2

Please sign in to comment.