DEV Community

Vuyani Daweti
Vuyani Daweti

Posted on

Similarities of laravel command and vue/react component props behavior

As a developer it is key to learn a skill that can be easily transfered to another domain with losing meaning.I think am starting to see how knowledge can truly shared across domains, here's an example.

In react when to pass props on a component we use command=value type of syntax as function arguement,we then take these arguments and process them. If they are boolean types we can just pass the name without value.

REACT/VUE

<Component show/>

SAME AS 
<Component show=true/>
Enter fullscreen mode Exit fullscreen mode

LARAVEL Commands

In laravel command do it the samoe way

php artisan commandName {show}

SAME AS 
php artisan commandName {show=true}

Enter fullscreen mode Exit fullscreen mode

Both these statement pass value=true by just being stated.The behavior is the same,though they are not declared on a similar manner.

This a good example of transfer behavior across different domains in programming.

Top comments (0)