Fork me on GitHub
#reagent
<
2017-05-19
>
minikomi02:05:53

what kind of input field?

minikomi02:05:55

plain text?

leontalbot02:05:48

Hello! I am using semantic ui react in reagent

leontalbot02:05:01

was wondering how would you convert this

<Modal trigger={<Button>Show Modal</Button>}>...</Modal>

leontalbot02:05:40

Tried this

[:> ui/modal {:trigger [:> ui/button "Show Modal"]} ...]

leontalbot02:05:06

Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined.

noisesmith02:05:01

I use reagent and I've never seen :> used like that, what is it?

gadfly36103:05:21

I have a modal example in there

gadfly36103:05:07

@noisesmith :> is syntactic suger for reagent/adapt-react-class

gadfly36103:05:13

@leontalbot basically for the trigger you need to use reagent/as-element

leontalbot03:05:27

really nice!

leontalbot03:05:34

It works! Thanks @gadfly361 !

dimovich08:05:40

@minikomi react-autosize-input.... but I ended up using komponentit/autosize

dimovich08:05:54

uses same logic, but doesn't have this issue with jumping cursor

pesterhazy08:05:19

@dimovich it's a common issue

pesterhazy08:05:03

reagent has some special logic to deal with cursor position of input fields

pesterhazy08:05:39

if you use a 3rd party wrapper, reagent has no way to apply these hacks

dimovich09:05:10

@pesterhazy I see... That was also my impression from reading the comments on https://github.com/facebook/react/issues/955

pesterhazy09:05:01

one thing that people have tried is to run force-update on every keypress, but not sure if that'll help in this case

dimovich09:05:42

another question... can I attach a component to a parent and not have to deal with for loops?

pesterhazy10:05:13

not sure what exactly you want to avoid

pesterhazy10:05:43

or what you want to achieve 🙂

dimovich10:05:14

by asking got to think a bit and have some ideas ... 🙂

juhoteperi17:05:01

Any ideas how this should be fixed?

juhoteperi17:05:29

As this namespace is not used when using Reagent as library, I'll add the http://java.io require back the file