Fork me on GitHub
#clojurescript
<
2019-10-11
>
itaied07:10:50

What's a recommended library for routing using re-frame (`reagent`)? I'm looking for a simple solution and an active library

Ludwig07:10:42

reitit is a good one

👆 20
itaied08:10:20

do you have an example of how to combine those two?

itaied08:10:29

re-frame and reitit

ianbishop16:10:13

Does anyone have experience with writing externs for monkey patched/object extended functions? I'm trying to use a React HOC (`stripe-react-elements`) that takes a component you define and returns it with functions extended onto it. I'm running into issues then calling those functions (i.e. mycomponent.monkeyPatchedFunction) with advanced compilation. I'm not super experience wrt react/re-frame/cljs in general so apologizes if this is poorly phrased. It almost seems like maybe the extern should be from the perspective of my component rather than the library itself?

thheller16:10:04

@ianbishop you only need to create externs for code you write. the best way to go about that is using :infer-externs and just adding a small typehint to prevent the renaming of a given thing

ianbishop16:10:14

@thheller Ah ok, I think I've conflated the two a bit since I also generated cljsjs externs for the lib. I'll take a look at doing that. Thanks!

Ramon Rios20:10:49

Someone faced this warning before? I think because of this my re-frame routing functions did not work

react-dom.inc.js:11632 Warning: componentWillMount has been renamed, and is not recommended for use. See  for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder. 

p-himik20:10:59

Yes, I've seen it. And I don't think that it affects the routing in any way. Most likely, the error is at some other place in your code.

Ramon Rios21:10:10

Got it. i watched that my code is going to db but then after it the dom is not generated

Ramon Rios21:10:32

It does not load again the function wich render the main panel

Dale20:10:33

I am surprised that CLJS's clojure.core/min doesn't behave identically to JS's Math.min. Math.min(0, null) → 0 but (min 0 nil) → nil. I am guessing I shouldn't file a bug?

lilactown20:10:52

I’m more surprised it doesn’t act like clj, since it results in a nullpointerexception there

Dale20:10:33

I'm not terribly upset about that, since ClojureScript says CLJS nil → JS null, and in JS null will gladly turn into a number for you.

mfikes23:10:05

@dale min is a numeric function and requires numeric arguments. Passing non-numeric arguments leads to undefined behavior.