From c6b20e4cb0540616f3606847feba9dbb93e79402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Stenstr=C3=B6m?= Date: Sat, 27 Feb 2021 16:40:16 +0100 Subject: [PATCH] Make registering a component with a decorator the default. --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index f2acee72..73d8cf26 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ Inside this file we create a Component by inheriting from the Component class an ```python from django_components import component - +@component.register("calendar") class Calendar(component.Component): def context(self, date): return { @@ -163,9 +163,6 @@ class Calendar(component.Component): class Media: css = {'all': ['[your app]/components/calendar/calendar.css']} js = ['[your app]/components/calendar/calendar.js'] - - -component.registry.register(name="calendar", component=Calendar) ``` And voilá!! We've created our first component.