Fork me on GitHub
#reagent
<
2018-06-28
>
troglotit09:06:37

@kasuko here’s one library I’ve seen https://github.com/district0x/district-ui-graphql - I think you might be interested. As for me, I understand GraphQL way easier than fulcro/om.next’s way of graph query. Plus, re-frame provides a way to make complex event processing logic much understandable. So I think re-frame + graphql would be really awesome.

colindresj16:06:12

How would I get ahold of a React component instance?

colindresj16:06:44

So that I could, for example, var x = <SomeComponent />; x.someMethod();?

justinlee16:06:41

@colindresj using ref is the most straightforward way

colindresj16:06:07

:thumbsup: Thanks

colindresj19:06:08

@pesterhazy Thanks, that’s how I’ve previously done them, but it looks like the latest React encourages you to go the React.createRef route vs callbacks

justinlee19:06:35

you don’t really need the createRef mechanism to do what you want to do, though. that interface is useful for forwarding refs around and through functional components

justinlee19:06:33

i don’t think they are deprecating callbacks

pesterhazy19:06:30

React is pretty good about backward compatibility, I wouldn't worry about deprecation

colindresj19:06:12

Sure, but it looks like the object created by createRef is effectively an atom in CLJS-terms (immutable container around value), so I feel like it’s a more convenient version of the same thing

qr419:06:23

Hi, I am trying to integrate https://www.npmjs.com/package/react-container-dimensions into my reagent + figwheel app. I used :npm-deps to define mine dependencies but whenever my component renders, I get an error inside the react-container-dimensions that ReactDOM is not defined, but in the stack trace I see a very helpful Error (Uncaught Error: ^_^) inside react-dom.inc.js . Also, when I require react-dom in my component, it is nil. Did anyone have a similar error yet 😄?

juhoteperi19:06:30

Looks like you are using cljsjs/react and cljsjs/react-dom as you have react-dom.inc.js. You can't mix cljsjs and npm-deps.

qr419:06:34

so just exclude them in the :dependencies ?

bhauman19:06:03

that and possibly require them in npm-deps

qr419:06:32

thank you, will try that 🙂

juhoteperi19:06:52

Installing react ja react-dom using npm should be enough. Cljsjs packages are still useful for externs, and the JS code from those is not used if npm packages are available.

qr419:06:39

I actually already had react and react-dom inside my npm-deps, isnt that equivalent?

justinlee19:06:27

does react work through :npm-deps? i thought it needed externs

juhoteperi19:06:28

Hm yes. Do you also have :install-deps true and are the packages present in node_modules? Also try cleaning output-dir.

juhoteperi19:06:52

what about create-react-class, I guess that can be easy to forget but Reagent uses that also

qr420:06:11

oh you’re right, I forgot about that one

juhoteperi20:06:17

@lee.justin.m Externs can be provided when using :npm-deps