Skip to content

Commit 8aefb7f

Browse files
committed
Generate makeProps and wrapper make for native mode
The new server-reason-react PPX (68070f3e) transforms uppercase JSX calls from Component.make(~prop, ()) to Component.make(Component.makeProps(~prop, ())). styled-ppx's native module generation didn't produce a makeProps function, causing 'Unbound value Cositas.makeProps' errors. Fix: for native mode, generate makeProps as a function that captures all labeled props into a closure (thunk) and a public make wrapper that invokes the thunk with ?key. The include struct...end pattern shadows the internal make with the public wrapper. Also fix the demo server.re to call CSS.style_tag() directly since it's a plain function, not a React component module.
1 parent 712c9a3 commit 8aefb7f

File tree

12 files changed

+2378
-13
lines changed

12 files changed

+2378
-13
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"version": 1,
3+
"lastRunAtMs": 0,
4+
"turnsSinceLastRun": 5,
5+
"lastTranscriptMtimeMs": null,
6+
"lastProcessedGenerationId": "5c59e9fa-8cd2-4751-9b74-b062db9c2e6b",
7+
"trialStartedAtMs": null
8+
}

.opencode/package-lock.json

Lines changed: 115 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/melange/server.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ print_endline("\n\n");
22
print_endline(ReactDOM.renderToStaticMarkup(<App />));
33

44
print_endline("\nStyle tag:");
5-
print_endline(ReactDOM.renderToStaticMarkup(<CSS.style_tag />));
5+
print_endline(ReactDOM.renderToStaticMarkup(CSS.style_tag()));

0 commit comments

Comments
 (0)