Created
April 9, 2017 23:46
-
-
Save wyze/9ebd6945f569019112cd845ead4c3693 to your computer and use it in GitHub Desktop.
More than one React component in a Reason file (module).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module WrapperA = { | |
module A = { | |
include ReactRe.Component; | |
let name = "A"; | |
type props = (); | |
let render _ => <div>(ReactRe.stringToElement "A")</div>; | |
}; | |
include ReactRe.CreateComponent A; | |
let createElement = wrapProps (); | |
}; | |
module WrapperB = { | |
module B = { | |
include ReactRe.Component; | |
let name = "B"; | |
type props = (); | |
let render _ => <div>(ReactRe.stringToElement "B")</div>; | |
}; | |
include ReactRe.CreateComponent B; | |
let createElement = wrapProps (); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AB = { | |
include ReactRe.Component; | |
let name = "AB"; | |
type props = (); | |
let render _ => | |
<div> | |
<Multi.WrapperA /> | |
<Multi.WrapperB /> | |
</div>; | |
}; | |
include ReactRe.CreateComponent AB; | |
let createElement = wrapProps (); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment