I'd like to use RNW for my next windows application, but it's not clicking for me; need some help getting started #8427
BenMakesGames
started this conversation in
General
Replies: 2 comments 1 reply
-
You'll have to manually surface your C# logic to your React Native JS through native modules, using '[ReactModule]` as you've raised (documentation here, more samples here). You said that made the compiler unhappy due to constructor parameters. Was that the only compiler issue? Is that a requirement for your types? Have you had luck replicating any of the examples in the docs/samples? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Communication between apps and modules can happen via the ReactPropertyBag object, which is an instance wide property bag. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an Angular background, and love component-based frameworks. I haven't used React before, but it feels pretty natural to me, and I'm excited to use it.
However, I'm unable to figure out how to structure an RNW application with a heavy C# backend (Entity Framework, etc), and I can't find many resources online (as to be expected, since RNW is so new).
My intuition is to structure a Windows application as follows:
Microsoft.Extensions.*
librariesI know that the above won't work as written: React is the starting point, already has DI, etc. Knowing that, I assume I need to register my C# services with React somehow. I've tried exporting service classes from RNW native modules using
[ReactModule]
and friends, but this makes the compiler unhappy: apparently native module classes need parameterless constructors. In retrospect, this makes sense: React JS and native C# services aren't going to be able to seamlessly depend on one another... but I need DI on the C# side, for the services defined there... and so I find myself stuck in a loop/trap.I feel as though I'm missing some bigger picture which would make everything fall into place, I'm just not sure where/how to find it. Any help would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions