From 52e585a2a5bd267a46c925a609bf7b2155a188d8 Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Mon, 25 Nov 2024 19:48:42 +0100 Subject: [PATCH] Rollback change on _ppx --- ppx/reason_react_ppx.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ppx/reason_react_ppx.ml b/ppx/reason_react_ppx.ml index df87542e0..8823c52e0 100644 --- a/ppx/reason_react_ppx.ml +++ b/ppx/reason_react_ppx.ml @@ -647,10 +647,8 @@ let jsxMapper = let expr = mapper#expression ctxt expr in match expr.pexp_desc with | Pexp_fun (Labelled "key", _, _, _) | Pexp_fun (Optional "key", _, _, _) -> - raise - (Invalid_argument - "Key cannot be accessed inside of a component. Don't worry - you \ - can always key a component from its parent!") + Location.raise_errorf ~loc:expr.pexp_loc + ("~key cannot be accessed from the component props. Please set the key where the component is being used.") | Pexp_fun ( ((Optional label | Labelled label) as arg), default,