#render a QRL that wraps a complex type

2 messages · Page 1 of 1 (latest)

gusty agate
#

I'm using BigNumber from the bignumber.js lib. Is it possible to render this type when it's returned from a QRL/$ function? I'm intentionally hoping to use BigNumber so I don't have to convert it to a primitive number yet. This play shows how it won't render because it's not of a type compatible with JSXChildren, and since a QRL is a Promise, I'm not sure it's possible to unwrap the value so I can coerce it with + via the valueOf override.

https://qwik.builder.io/playground/#v=1.1.5&f=7VbLCsIwELz7FTkITTEICiIU9eBFBB%2FoH4j4KJRaWiuI9N%2Bd3aRNq8V6FTw1NLthZnf2URLNsDewiWqrkgJwropNic12oWpkyf94Pn%2FUmt4Zpv5ppWcERYQDFad7OMso9m%2FUjzFCPLM5IFEZrFB16WF9lK6XzxfyLeKp35NXNJQu7sFRiAx5a9lBqDs9ee3CMN0Fs%2FiSJPMQbA8e0Rqxt6ftOF8FTtI5wHNG%2BdqwF2PC%2F1KPbDCRDn8dIPmqwsxKxBjHdtkxj2mutcjb0uq8QiD3KWJEw7GgJJ1en8Bpi8xVfKJqpm9N3ynzVhoocbO9wWgsmixhdA7umKWAKXKcjw77dN8oSDejVtLg3egMcf%2B70a92oyc

Qwik

No hydration, auto lazy-loading, edge-optimized, and fun 🎉!

gusty agate
#

This pattern also makes it impossible to do other simple transformations such as something like

{UsDollar.format(state.annualGrossIncome())}