janseevers
11/08/2017, 12:13 PMdavide
11/08/2017, 11:47 PMdiegog
11/22/2017, 6:31 PMfranck
12/29/2017, 3:29 AMTypeError: Kotlin.defineModule is not a function
(anonymous function)
<http://localhost:3000/static/js/bundle.js:29147:10>
map../components/menu/Menu.css
<http://localhost:3000/static/js/bundle.js:29149:2>
Is that something you've seen before ? ThanksTristan Caron
02/07/2018, 10:20 PM@file:JsModule("antd/lib/button")
package antd.lib.button
import react.RProps
import react.RState
import react.React
import react.ReactElement
@JsName("Button")
external class ButtonComponent : React.Component<RProps, RState> {
override fun render(): ReactElement?
}
And I try to use through
package antd.lib.button
import react.RBuilder
import react.RHandler
import react.RProps
fun RBuilder.antdButton(handler: RHandler<RProps>) = child(ButtonComponent::class, handler)
But I get in the console
reflection.kt?8f80:61 Uncaught TypeError: Cannot read property '$metadata$' of undefined
at getOrCreateKClass (reflection.kt?8f80:61)
at getKClass (reflection.kt?8f80:23)
at antdButton (dsl.kt?502b:11)
at Home.render_ss14n$ (Home.kt?7b40:13)
at eval (ReactComponent.kt?fdb7:74)
at buildElements (RBuilder.kt?4494:73)
at Home.RComponent.render (ReactComponent.kt?fdb7:74)
at finishClassComponent (react-dom.development.js?9c26:7873)
at updateClassComponent (react-dom.development.js?9c26:7850)
at beginWork (react-dom.development.js?9c26:8225)
react-dom.development.js?9c26:9747 The above error occurred in the <Home> component:
in Home (created by Route)
in Route
in div
in Router (created by BrowserRouter)
in BrowserRouter
Do you know what I am missing?ryannerd
02/14/2018, 7:56 AMSetState(JSobject, function(){callBack code})
is as @Filipp Riabchun said the state is batched and asynchronous. Meaning that the state change isn't immediate and in JS React if you need to have some action occur when the state actually changes you include a call back function as the second argument. I'm not sure how Kotlin transpiles the JS for this.ryannerd
02/14/2018, 6:03 PMchadmorrow
02/28/2018, 3:42 AMchadmorrow
02/28/2018, 3:45 AMneworldlt
03/06/2018, 5:50 PMFilipp Riabchun
03/13/2018, 3:10 PMkotlin-webpack-plugin
setup instructions: https://github.com/JetBrains/create-react-kotlin-app/tree/master/packages/kotlin-webpack-plugin
Your kotlin module will be available as CommonJS module thendeviant
03/15/2018, 8:27 PMkotlinx.serialization
with CRKA
?Filipp Riabchun
03/21/2018, 8:14 PMFilipp Riabchun
03/21/2018, 8:15 PM+
like with stringssnrostov
03/22/2018, 11:22 AM+MyComponent(prop1, prop2)
. There is old prototype here: https://htmlpreview.github.io/?https://raw.githubusercontent.com/snrostov/ui-dsl/master/index.html#hello-widgetssamir
05/03/2018, 8:09 PMoverride fun RBuilder.render() {
val options = listOf("foo", "bar", "baz")
select {
attrs.value = "foo"
attrs.onChangeFunction = {}
options.forEach {
option {
key = it
attrs.value = it
+it
}
}
}
}
Warning: The value prop supplied to <select> must be a scalar value if multiple is false.
chadmorrow
05/04/2018, 8:48 PMsamir
05/08/2018, 7:10 PMnpm run gen-idea-libs
successfully with 1.0.8
?
> react-scripts-kotlin gen-idea-libs
fs.js:124
throw new ERR_INVALID_CALLBACK();
^
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at maybeCallback (fs.js:124:9)
at Object.fs.writeFile (fs.js:1244:14)
at Object.keys.forEach.name (/Users/sam/IdeaProjects/dl-web-portal/node_modules/@jetbrains/gen-idea-libs/generate.js:46:8)
at Array.forEach (<anonymous>)
at generate (/Users/sam/IdeaProjects/dl-web-portal/node_modules/@jetbrains/gen-idea-libs/generate.js:43:25)
at Object.<anonymous> (/Users/sam/IdeaProjects/dl-web-portal/node_modules/react-scripts-kotlin/scripts/gen-idea-libs.js:20:1)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! dl-portal@0.1.0 gen-idea-libs: `react-scripts-kotlin gen-idea-libs`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the dl-portal@0.1.0 gen-idea-libs script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/sam/.npm/_logs/2018-05-08T19_07_25_518Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/local/lib/node_modules/node/bin/node’,
1 verbose cli ‘/usr/local/bin/npm’,
1 verbose cli ‘run’,
1 verbose cli ‘gen-idea-libs’ ]
2 info using npm@6.0.0
3 info using node@v10.0.0
4 verbose run-script [ ‘pregen-idea-libs’, ‘gen-idea-libs’, ‘postgen-idea-libs’ ]
5 info lifecycle dl-portal@0.1.0~pregen-idea-libs: dl-portal@0.1.0
6 info lifecycle dl-portal@0.1.0~gen-idea-libs: dl-portal@0.1.0
7 verbose lifecycle dl-portal@0.1.0~gen-idea-libs: unsafe-perm in lifecycle true
8 verbose lifecycle dl-portal@0.1.0~gen-idea-libs: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/sam/IdeaProjects/dl-web-portal/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle dl-portal@0.1.0~gen-idea-libs: CWD: /Users/sam/IdeaProjects/dl-web-portal
10 silly lifecycle dl-portal@0.1.0~gen-idea-libs: Args: [ ‘-c’, ‘react-scripts-kotlin gen-idea-libs’ ]
11 silly lifecycle dl-portal@0.1.0~gen-idea-libs: Returned: code: 1 signal: null
12 info lifecycle dl-portal@0.1.0~gen-idea-libs: Failed to exec gen-idea-libs script
13 verbose stack Error: dl-portal@0.1.0 gen-idea-libs: `react-scripts-kotlin gen-idea-libs`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:283:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:947:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:236:5)
14 verbose pkgid dl-portal@0.1.0
15 verbose cwd /Users/sam/IdeaProjects/dl-web-portal
16 verbose Darwin 17.5.0
17 verbose argv “/usr/local/lib/node_modules/node/bin/node” “/usr/local/bin/npm” “run” “gen-idea-libs”
18 verbose node v10.0.0
19 verbose npm v6.0.0
20 error code ELIFECYCLE
21 error errno 1
22 error dl-portal@0.1.0 gen-idea-libs: `react-scripts-kotlin gen-idea-libs`
22 error Exit status 1
23 error Failed at the dl-portal@0.1.0 gen-idea-libs script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
samir
05/16/2018, 6:27 PMTypeError: Cannot read property '$metadata$' of undefined
used ts2kt and added @JsName("AceEditor")
external class AceEditor : Component<AceEditorProps, RState> {
override fun render(): ReactElement?
}
chadmorrow
05/21/2018, 12:35 AMStyledComponents.injectGlobal(styles.toString())
to inject global styles. However, it doesn't specify where you can call that. I've tried calling it from just about every part of my app and can never get it to work. I always get a receiver mismatch error. Could someone help provide a little more context on how this is used?cfnz
05/30/2018, 9:24 PMWarning: Invalid DOM property `for`. Did you mean `htmlFor`?
in label (created by App)
in App
so something still seems a bit wrong, which might be causing my initial issue in more complex code?Nail Gilaziev
06/18/2018, 6:00 PMfunction WelcomeDialog() {
return (
<FancyBorder color="blue">
<h1 className="Dialog-title">
Welcome
</h1>
<p className="Dialog-message">
Thank you for visiting our spacecraft!
</p>
</FancyBorder>
);
}
from this tutorial https://reactjs.org/docs/composition-vs-inheritance.htmlNail Gilaziev
06/23/2018, 9:11 AMReactDOMComponent
from package react.dom
that now doesn’t exist in this package. These sources are not relevant as I understand because I can’t use this code in
newly created app from create-react-kotlin-app tool.
class Application : ReactDOMComponent<ReactComponentNoProps, ApplicationPageState>() {
companion object : ReactComponentSpec<Application, ReactComponentNoProps, ApplicationPageState>
}
what is the actual way for using this code to achive the same result - calling Application{}
in render function without creating convenient function
ReactDOM.render(document.getElementById("content")) {
div {
Application {}
}
}
samir
06/25/2018, 8:38 PMnpm i core-js@^2.5.3 ajv-keywords@3.2.0
chadmorrow
07/02/2018, 3:37 PMNail Gilaziev
07/16/2018, 12:07 PMAlexander Mikhalchenko
10/11/2018, 5:41 AMdavide
10/24/2018, 12:01 AMgalex
01/22/2019, 8:49 AM