Comments (5)
Hi Artur. React component constructors (ReactComponentC
) have a method called withKey
which you can use for this purpose. Example:
val c = ReactComponentB[Int]...build
val nokey = c(123)
val keyed = c.withKey("key")(123)
from scalajs-react.
Thanks japgolly. This is new in the later version, right? (0.5.0). I had forgotten to update!
I have another comment. It's a bit offtopic but I didn't want to open another issue since I understand it's not really a scalajs-react issue. The thing is that after updating to 0.5.0 syntax highlighting with IntelliJ is utterly and completely broken, all around the code. It also happened when I tried to update from 0.4.0 to 0.4.1. Do you use this editor, and if so, do you have any tips on how to fix the issue?
from scalajs-react.
Intellij's highlighting is very buggy, I'm used to red everywhere now. You should be fine with scalajs-react though, the only thing that it consistently highlights wrong are React.renderComponent(...)
and ReactS.>>
. Everything else should be fine. Sometimes I've seen it freak out and highlight everything red then I usually go File>InvalidateCaches>InvalidateAndRestart and it fixes itself. The other week though I was too intent on a problem and didn't restart it and then later it just magically fixed itself.
from scalajs-react.
The Invalidate Caches thing worked! I didn't know that trick, thanks a lot!
from scalajs-react.
No worries, happy coding! =D
from scalajs-react.
Related Issues (20)
- Export `assertOuterHTML` HOT 1
- Deprecate `Mounted` component types HOT 2
- Add default arg to `ReactTestUtils.withRendered` HOT 1
- ScalaFnComponent is anonymous HOT 2
- Consider using `DocumentFragments` in `ReactTestUtils` HOT 1
- Re-evaluate `ComponentDom` post- React 18
- Is there a way to integrate Components with cats.effect.Ref? HOT 1
- Ref not always set HOT 2
- Syntax to integrate `useContext` with context function in Scala 3 HOT 1
- Compilation fails in Scala 3 when deriving Reusability for case classes with multiple parameter groups HOT 1
- Missing getDerivedStateFromError
- Missing / misspelled packages in MODULES.md HOT 1
- Add support for Discussions tab in Github HOT 1
- Modern testing recipe?
- Cannot mix static and dynamic routes even if conditional
- A minimal setup fails with Scala 3 HOT 5
- Provide default IO/SyncIO error handler for component
- ScalaFnComponent doesn't include displayName HOT 1
- Another way to define hook components
- AsyncCallback + cats, gracefully handling errors with EitherT: unexpected behaviour HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scalajs-react.