Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Sep 21 05:08
    dependabot[bot] labeled #13
  • Sep 21 05:08
    dependabot[bot] opened #13
  • Sep 21 05:08

    dependabot[bot] on npm_and_yarn

    Bump tmpl from 1.0.4 to 1.0.5 … (compare)

  • Sep 21 05:03
    dependabot[bot] labeled #17
  • Sep 21 05:03
    dependabot[bot] opened #17
  • Sep 21 05:03

    dependabot[bot] on npm_and_yarn

    Bump tmpl from 1.0.4 to 1.0.5 … (compare)

  • Aug 11 04:05
    dependabot[bot] labeled #12
  • Aug 11 04:05
    dependabot[bot] opened #12
  • Aug 11 04:05

    dependabot[bot] on npm_and_yarn

    Bump path-parse from 1.0.5 to 1… (compare)

  • Aug 11 04:02
    dependabot[bot] labeled #16
  • Aug 11 04:02
    dependabot[bot] opened #16
  • Aug 11 04:02

    dependabot[bot] on npm_and_yarn

    Bump path-parse from 1.0.5 to 1… (compare)

  • May 12 01:22
    dependabot[bot] labeled #11
  • May 12 01:22
    dependabot[bot] opened #11
  • May 12 01:22

    dependabot[bot] on npm_and_yarn

    Bump merge from 1.2.0 to 1.2.1 … (compare)

  • May 12 01:18
    dependabot[bot] labeled #15
  • May 12 01:17
    dependabot[bot] opened #15
  • May 12 01:17

    dependabot[bot] on npm_and_yarn

    Bump merge from 1.2.0 to 1.2.1 … (compare)

  • May 10 16:22
    dependabot[bot] labeled #10
  • May 10 16:22
    dependabot[bot] opened #10
Zahari Dichev
@zaharidichev
I was looking through the code but did not find any examples
Chandra Sekhar Kode
@chandu0101
@zaharidichev extraProps takes js.Object ,extraProps = js.Dynamic.literal(maxLength = 10, returnKeyType = "Enter")
Zahari Dichev
@zaharidichev
thank you
Zahari Dichev
@zaharidichev
Hi there guys, I am wondering whether there is s way to set the parameters of a navigator from within a NavigationScreenComponent. Pretty much what I want to do is to have a header button that is interacting with the state of the screen component I am currently within. What is a proper way to do that ? I assume its via the parameters ?
Zahari Dichev
@zaharidichev
Also, have you guys ever experimented with using SRI with redux ?
Chandra Sekhar Kode
@chandu0101

Also, have you guys ever experimented with using SRI with redux

diode is scala redux+!

ashu2012
@ashu2012
Hi @chandu0101 , I know your busy can you answer few questions :- did sri is updated with latest scala-js react ? and as native apps doesn't have dom e.t.c so code already written using scala-js react can be added easily or i have do complete rewrite ?
Chandra Sekhar Kode
@chandu0101

did sri is updated with latest scala-js react

did you mean David's scalajs-react ? if yes, no sri doesnt have scalajs-react interop layer.

ashu2012
@ashu2012
but your code looks similar as you explained in docs :-ScalaJS wrapper for react-native .This project depends on scalajs-react , so you must be familiar with scalajs-react in order to use this library.
calajs-react-native comes with ReactNativeComponentB (its clone of scalajs-react ReactComponentB with native dependencies and extra helper methods ).
@chandu0101 am i looking into old docs ?
Chandra Sekhar Kode
@chandu0101
yes , i am not linked to scalajs-react-native anymore.
ashu2012
@ashu2012
so what must be my bet if i want to build react-native if already have web app using scalajs- react japgolly . I want to use some native component as camera and opening web page is not available in mobile in webview.
@chandu0101 shall i look elsewhere like shadaj react native e.t.c ?
Chandra Sekhar Kode
@chandu0101
hmm , sri react-native is mature than other existing solutions out there !.but current examples doesnt work with latest react-native. @zaharidichev have local updated version, hope they'll push soon.
Vadim Bondarev
@haghard
Hello folks, I’d like to ask the follo
wing question: Is it possible to pass some params from MainActivity/MainApplication to MobileApp.scala(hope you see what I mean)
Vadim Bondarev
@haghard
Anyone ? Please
Chandra Sekhar Kode
@chandu0101
@haghard i dont know, ask in react-native discord channel
Jack
@JackDavidson
Hey, I was able to get a react-native-web app working with SRI (so its cross platform web, android, and ios) with SRI, but for web ('react-scripts start') I get eslint errors about undefined functions. I cant seem to modify the eslint rules, either. My workaround has been to an eslint-ignore comment to the top of the .js file that SRI outputs, and everything works fine but its a manual step. Do you know any way that I could edit the build.sbt file to automatically add the eslint-ignore line at the top? Also, I plan to make a public git repo with this as soon as I get it working.
Nikolay Khoroshevskyi
@rossoha
@chandu0101 Is it possible to expose function from components in SRI ? component that in the end will be analog of
class Step extends React.Component {
  constructor(props) {
 this.state = {
// State fields. 
    };
  }
  sendState() {
    return this.state;
  }

 render() {
    const { prop, classes } = this.props;
// Render stuff
  }
}
Jack
@JackDavidson
@NikolayKhoroshevsky Are you trying to ask if you can export components defined in RSI for use in react?
Nikolay Khoroshevskyi
@rossoha
@JackDavidson Yes. :)
Jack
@JackDavidson
then yeah, definetly. but IDK about the properties. you could probably export a function that will act like what you want

`import sri.universal.components.TextC
import scala.scalajs.js.annotation.JSExportTopLevel
import scala.language.postfixOps

object MobileApp {
def main(args: Array[String]) = {}
@JSExportTopLevel("MyExportedComponent")
val MyExportedComponent = TextC("some text")
}`

import sri.universal.components.TextC
import scala.scalajs.js.annotation.JSExportTopLevel
import scala.language.postfixOps

object MobileApp {
  def main(args: Array[String]) = {}
  @JSExportTopLevel("MyExportedComponent")
  val MyExportedComponent = TextC("some text")
}
then in react
render() {
  const MyStuff = require("./assets/js/scalajs-output-android").MyExportedComponent;
  return MyStuff
}
Nikolay Khoroshevskyi
@rossoha
Great! Thanks.
And one more question: my first goal is to have function exposed ( sendState in my example ). So if TextC would have a function without any access modifiers, it would be visible from js perspective as a usual function?
I’m asking because from what I see in scalajs-react it’s not clear or not possible, so I thinking about switching my project to SRI.
Jack
@JackDavidson
@NikolayKhoroshevsky I'm playing around with it, and it looks like there is some funkyness
Jack
@JackDavidson
@NikolayKhoroshevsky ok, here you can export a function:

object MobileApp {
def main(args: Array[String]) = {}
@JSExportTopLevel("MyExportedComponent")
def MyExportedComponent(text: String) = TextC(text)

}

Have you used react before, btw? a 'sendState' function is something I've never had use for in react. Generally I pass everything as properties
what your describing is possible though, you would want @ExportJS on the function that you want to be callable
Jack
@JackDavidson
@JSExportTopLevel("MyExportedComponent")
class MyCustomText(text: String) {
  var someVar = "initialValue"
  @JSExport
  def setSomeVar(text: String): Unit = {
    someVar = text
  }
  @JSExport
  def render(): ReactElement = {
    return TextC(text + someVar)

  }
}
then in react:
    const SRI = require("./assets/js/scalajs-output-android").MyExportedComponent;
    const SRIWText = SRI('starting text ')
    console.log('sri w text is:')
    console.log(SRIWText)
    SRIWText.setSomeVar('some new text')
    return SRIWText.render()
image.png
you can see the state of the component getting changed between the console.log and when it actually gets rendered
Nikolay Khoroshevskyi
@rossoha
@JackDavidson. Awesome! That’s what I wanted. Many thanks!
Jack
@JackDavidson
no problem. glad I could help :)
I'm still learning this too, haha. I actually just started working with this stuff on Monday.
Nikolay Khoroshevskyi
@rossoha
: )
Jack
@JackDavidson
ok, I managed to solve my issue. I figured out how to edit the fastOptJS task to append my step for disabling eslint
Jack
@JackDavidson
I have a sample sri-native plus react-native-web project finally: https://github.com/JackDavidson/Scalajs-React-Native-Web-Starter Still a bunch of work to do to give people a nice starting point though. its nothing more than some text on a page. One great thing about the way it works is that it does not require the additional SRI sbt plugin, it relies only on the scalajs plugin plus a small bit of extra sbt config to work around react's strict enforcing of eslint no-undef rule.
Jack
@JackDavidson
@chandu0101 Do you have any examples of using local images in scalajs-react-interface-native? I tried to create an image, and nothing showed up. I looked at the output javascript and it doesn't look right either. I modified the javascript directly to include a require of the image, and that worked. Originally, it was something like createElement(Image, {source:{uri:'my-img.png'}} and I was expecting (and what worked) was createElement(Image, {source: require('my-img')}}
Jack
@JackDavidson
I was able to define my own version of the ImageComponent that works fine with react-native. If this is an issue with the built-in Image, I'll submit a pull request with my code. What didn't work was: 'val img = Image(source = ImageSource("../my-image.png"))' A call to my replacement code looks like 'val img = MyImage(MyAssetLoader.require("../my-image.png"))'