This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,7 @@ let makeModuleName fileName nestedModules fnName =
175
175
176
176
(* make record from props and spread props if exists *)
177
177
let recordFromProps ~loc ~removeKey callArguments =
178
+ let spreadPropsLabel = " _spreadProps" in
178
179
let rec removeLastPositionUnitAux props acc =
179
180
match props with
180
181
| [] -> acc
@@ -185,13 +186,13 @@ let recordFromProps ~loc ~removeKey callArguments =
185
186
" JSX: found non-labelled argument before the last position"
186
187
| ((Labelled txt, {pexp_loc}) as prop) :: rest
187
188
| ((Optional txt , {pexp_loc} ) as prop ) :: rest ->
188
- if txt = " _spreadProps " then
189
+ if txt = spreadPropsLabel then
189
190
match acc with
190
191
| [] -> removeLastPositionUnitAux rest (prop :: acc)
191
192
| _ ->
192
193
React_jsx_common. raiseError ~loc: pexp_loc
193
- " JSX: spread props should be first in order than other props \n \
194
- \ and multiple spread props are not allowed."
194
+ " JSX: use {...p} {x: v} not {x: v} {...p} \n \
195
+ \ multiple spreads {...p} {...p} not allowed."
195
196
else removeLastPositionUnitAux rest (prop :: acc)
196
197
in
197
198
let props, propsToSpread =
You can’t perform that action at this time.
0 commit comments