From 4d45b2136311a238e75d1121ea86cf64d6ac3b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sat, 27 Feb 2021 00:13:54 +0100 Subject: [PATCH] clearer sentence --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ea3bf81..f4f1353 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ component('example', ExampleComponent); Which will make it accessible using `Alpine.component('example')('foo', 'bar)`. -**Note: It's better to avoid using `Alpine.component('example', ExampleComponent)`** even if it might work in some cases. The reason for this is that `window.Alpine` might not yet be accessible when you're registering components, and if it is, it's possible that it's already evaluated some of the `x-data` attributes. `component()` is guaranteed to work. And of course, you can alias the import if you wish to use a different name. +**Note: You may notice that `Alpine.component()` can also be used to register components. Hoewver, it's better to avoid using it.** The reason for this is that `window.Alpine` might not yet be accessible when you're registering components, and if it is, it's possible that it's already evaluated some of the `x-data` attributes. `component()` is guaranteed to work. And of course, you can alias the import if you wish to use a different name. To register multiple components, you can use the `registerComponents()` helper.