Dmitriy Malayev
07/21/2023, 10:21 PMDmitriy Malayev
07/26/2023, 9:10 PMDmitriy Malayev
07/26/2023, 9:11 PMDmitriy Malayev
07/26/2023, 9:11 PMFlorent Martin
08/01/2023, 3:40 PMGridProps
.
Is there a new way of using it?spand
08/14/2023, 7:30 AMUnresolved reference: react
errors. Is this a known problem ? The changelog mentions "Kotlin 1.9.0 support" but not that 1.8 is no longer working. I am using kotlin 1.8.20Slackbot
08/14/2023, 3:03 PMSalman
08/17/2023, 3:04 PM_TreeView_ *{*
// Tree view props here
_treeItemComponent_(props.groups)
}
fun ChildrenBuilder.treeItemComponent(data: FacilityGroupsDataClass): Unit = _TreeItem_ *{*
nodeId = data.groupId.toString()
label = _ReactNode_(data.groupName)
expandIcon =_ExpandMore_._create_()
collapseIcon =_ExpandLess_._create_()
data.childGroups?._forEach_ *{* child *->*
_treeItemComponent_(child)
}
}
spand
08/18/2023, 9:39 AMreturn (
<button {...listeners}>
{props.children}
</button>
);
Salman
08/21/2023, 11:02 AMRichard Glen
08/22/2023, 10:33 PMLuc Girardin
08/25/2023, 9:40 AMPopper {
ClickAwayListener {
ReactHTML.img {
}
}
}
and get the error Unit' can't be called in this context by implicit receiver.
Seems like ClickAwayListener is no longer accepting children. Any idea on how to fix that?Florent Martin
08/28/2023, 8:10 AMreact.dom.html.HTMLAttributes<web.html.HTMLDivElement>
are actually missing because it is not there anymore (new PaperOwnProps
)
Errors are Unresolved reference: className
or Unresolved reference: id
using f.e:
Card {
className = ClassName("my-classname")
I guess this need to be added in a MR.Richard Ulysse
08/29/2023, 5:40 PMBjörn Lilleike
08/30/2023, 12:26 PMLuc Girardin
08/31/2023, 1:31 PMClickAwayListener
component with recent version of Kotlin Wrappers. It used to work in the past (not sure since when it stopped working), but now I get Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
. I use it in conjonction with Popper
, which is getting deprecated. Can this be the cause of the problem? If yes, then the Popup
(https://mui.com/base-ui/react-popup/) replacement is not yet available. Otherwise, any advise about the direction in which I should hunt?spand
09/01/2023, 8:54 AMexternal interface FieldProps : Props {
var goalkeeper: ReactNode?
}
FootballField {
goalkeeper = <what goes here?>
}
However, I cannot find a way to create this component. I expected a function with the a signature like (analogous to the invoke
from ChildrenBuilder
):
fun <P : Props> createElement(
type: ElementType<P>,
block: P.() -> Unit,
): ReactElement<P>
But I cannot find anything other than the quite primitive createElement
.
Is it wrong to pass in components in this way or how should this be done ? I find it hard to believe I am the first with this need
Solved:
This seems to work:
fun <P : Props> ElementType<P>.create(
block: @ReactDsl P.() -> Unit,
): ReactElement<P>
Dirk
09/05/2023, 8:19 AMSteven
09/08/2023, 11:50 AMexternal fun require(path: String): String
does not work anymore; I get the error: Uncaught ReferenceError: require is not defined
. Does anyone know the cause?Dmitriy Malayev
09/18/2023, 5:55 PMHello. I am trying to implement a progress bar when a user tries to download a report and I'm getting errors
suspend fun downloadReportSection(
reportFileName: String,
section: EsgSection? = null,
progressCallback: (Int) -> Unit
): ByteArray? {
return try {
val response = httpClient.get("${BackendReportingServiceURL}/esg-report/preview-report") {
parameter("reportFileName", reportFileName)
section?.let { parameter("section", it.name) }
onUpload { bytesSentTotal, contentLength ->
val progressPercentage = ((bytesSentTotal / contentLength.toDouble()) * 100).toInt()
progressCallback(progressPercentage)
}
}
if (response.status == HttpStatusCode.OK) {
progressCallback(100) // 100% completion once done
return response.readBytes()
} else {
null
}
} catch (e: Exception) {
console.log("Error: ${e.message}")
null
}
}
Box {
Button {
variant = ButtonVariant.contained
onClick = {
mainScope.launch {
val pdfReport = downloadReportSection(
props.esgReportStateProps.reportFileName,
EsgSection.General,
progressCallback = {}
)
pdfReport?.let {
val blob = Blob(arrayOf(it), BlobPropertyBag("application/pdf"))
val url = URL.createObjectURL(blob)
val a = document.createElement("a") as HTMLAnchorElement
a.href = url
a.download = props.reportStateProps.reportFileName
a.click()
}
}
}
+"Preview"
}
}
Could not load content for /kotlinx-coroutines-core/js/src/internal/CoroutineExceptionHandlerImpl.kt?6a41 (Fetch through target failed: Unsupported URL scheme; Fallback: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME)
Error_0 {message: 'Fail to fetch', cause: TypeError: Failed to execute 'fetch' on 'Window': Request with GET/HEAD method cannot have body.
Shubham Singh
09/30/2023, 6:36 AMRichard Ulysse
10/19/2023, 7:31 PMDmitriy Malayev
11/20/2023, 3:20 PMHildebrandt Tobias
11/30/2023, 2:44 PMandylamax
12/01/2023, 7:57 PMkotlin-wrappers:kotlin-react-core
is an amazing library filled with very well described externals for react. I like how it is separated from kotlin-react
which brings convenience functions to be used from kotlin. However, I have faced some challenges using these wrappers on our own kotlin/react library that has got to be consumed from typescript
When we publish our kotlin/react library, it ends up having a react dependency in it's package.json
which forces our consumers to update to the react version from kotlin-wrappers:kotlin-react
and kotlin-wrappers:kotlin-react-core
as bundled by our kotlin/react library.
This can be challenging and problematic. My request to @turansky is can we add react
as an peerDependency
to kotlin-wrappers:kotlin-react
and kotlin-wrappers:kkotlin-react-core
so that our users won't be forced to use react
that comes from these amazing libraryHildebrandt Tobias
12/04/2023, 11:14 AMuseContext
.
So do I need to apply the way described here: https://stackoverflow.com/questions/74757787/react-data-router-pass-context-to-loader
or is there a simpler way that I don't see for this overall issue?Hakon Grotte
12/21/2023, 10:06 AMkeepPreviousData
flag in React Query’s useQuery
through placeHolderData
?
Through the kotlin-wrappers the former is defined as external fun <T> keepPreviousData(previousData: T?): T?
and the latter as Any
, with some types commented out. Library docs: Tanstack Query docs
I’m using wrappers-bom:1.0.0-pre.668.Jay Carey
01/10/2024, 11:55 AMSalman
02/22/2024, 4:12 PM_TextField_ *{*
+props
variant = FormControlVariant.outlined
type = InputType.number
fullWidth = true
}
Paul Meshkovsky
02/22/2024, 7:00 PMentrypoint size limit: The following entrypoint(s) combined asset size exceeds
and during the build this doesn't generate entry-point-file.js needed to run our react app
We are using gradle 8.6. which specific webpack is this version tied to... how can I see this
As we suspect the latest release https://github.com/webpack/webpack/releases/tag/v5.90.3