This content originally appeared on DEV Community and was authored by Vuyani Daweti
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/>
LARAVEL Commands
In laravel command do it the samoe way
php artisan commandName {show}
SAME AS
php artisan commandName {show=true}
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.
This content originally appeared on DEV Community and was authored by Vuyani Daweti
Vuyani Daweti | Sciencx (2024-08-29T20:12:38+00:00) Similarities of laravel command and vue/react component props behavior. Retrieved from https://www.scien.cx/2024/08/29/similarities-of-laravel-command-and-vue-react-component-props-behavior/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.