Skip to content

Commit

Permalink
React. Use ComponentType instead of ComponentClass
Browse files Browse the repository at this point in the history
  • Loading branch information
turansky committed Jan 2, 2025
1 parent ce4c1dc commit 7b3e5e5
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package react.beautiful.dnd

import js.array.ReadonlyArray
import react.ComponentClass
import react.ComponentType
import react.PropsWithChildren
import react.ReactNode

Expand All @@ -17,4 +17,4 @@ sealed external interface DragDropContextProps : PropsWithChildren, Responders {
var sensors: ReadonlyArray<Sensor>?
}

external val DragDropContext: ComponentClass<DragDropContextProps>
external val DragDropContext: ComponentType<DragDropContextProps>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package react.beautiful.dnd

import react.ComponentClass
import react.ComponentType
import react.Props

sealed external interface DraggableProps : Props {
Expand All @@ -14,4 +14,4 @@ sealed external interface DraggableProps : Props {
var shouldRespectForcePress: Boolean?
}

external val Draggable: ComponentClass<DraggableProps>
external val Draggable: ComponentType<DraggableProps>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package react.beautiful.dnd

import react.ComponentClass
import react.ComponentType
import react.Props
import react.ReactElement
import react.dom.html.HTMLAttributes
Expand All @@ -24,4 +24,4 @@ sealed external interface DroppableProps : Props {
) -> ReactElement<out HTMLAttributes<*>>
}

external val Droppable: ComponentClass<DroppableProps>
external val Droppable: ComponentType<DroppableProps>
4 changes: 2 additions & 2 deletions kotlin-react-popper/src/jsMain/kotlin/react/popper/Manager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

package react.popper

import react.ComponentClass
import react.ComponentType
import react.PropsWithChildren

external interface ManagerProps : PropsWithChildren

external val Manager: ComponentClass<PropsWithChildren>
external val Manager: ComponentType<PropsWithChildren>
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ external interface PopperProps : Props {
var onFirstUpdate: (state: State) -> Unit
}

external val Popper: ComponentClass<PopperProps>
external val Popper: ComponentType<PopperProps>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ external interface ReferenceProps : Props {
var innerRef: Ref<*>
}

external val Reference: ComponentClass<ReferenceProps>
external val Reference: ComponentType<ReferenceProps>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package react.select

import react.ComponentClass
import react.ComponentType
import react.ReactNode

external interface CreatableSelectProps<Option : Any, Group : GroupBase<Option>> : SelectProps<Option, Group> {
Expand Down Expand Up @@ -48,4 +48,4 @@ external interface CreatableSelectProps<Option : Any, Group : GroupBase<Option>>
}

@JsName("default")
external val CreatableSelect: ComponentClass<CreatableSelectProps<*, *>>
external val CreatableSelect: ComponentType<CreatableSelectProps<*, *>>
4 changes: 2 additions & 2 deletions kotlin-react-select/src/jsMain/kotlin/react/select/Select.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package react.select

import js.objects.JsPlainObject
import react.ComponentClass
import react.ComponentType
import react.Key
import react.PropsWithClassName
import react.ReactNode
Expand Down Expand Up @@ -257,4 +257,4 @@ external interface SelectProps<Option : Any, Group : GroupBase<Option>> : PropsW
}

@JsName("default")
external val Select: ComponentClass<SelectProps<*, *>>
external val Select: ComponentType<SelectProps<*, *>>

0 comments on commit 7b3e5e5

Please sign in to comment.