Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Does anyone have any experience getting a code-editor plugin working with React and TypeScript. I’ve tried like 4 different packages and they’re all a pain to integrate

Adbot
ADBOT LOVES YOU

reversefungi
Nov 27, 2003

Master of the high hat!

Grump posted:

Does anyone have any experience getting a code-editor plugin working with React and TypeScript. I’ve tried like 4 different packages and they’re all a pain to integrate

What do you mean, like basic support for handling those frameworks with an editor? VS Code has all that stuff right out of the box, and you can always find some more extensions if you want some extra features.

Edit: It sounds like you mean components for React that let you create a code-editing text field, like this http://securingsincity.github.io/react-ace/? In which case, never mind :shrug:

reversefungi fucked around with this message at 23:45 on Jul 9, 2018

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself
Yeah i meant the latter. React ace looks awesome but is seemingly impossible to get setup with TypeScript

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
Well I just marked my ticket as DECLINED because it's clear after my third (fourth?) retry, I'm never going to get that Angular POC (more like POS) to work.

Maybe I'll feel better being tasked other things an idiot baby like myself can actually deliver.

Boosh!
Apr 12, 2002
Oven Wrangler
I have a child component with some form elements. On submit it would add an object to the parent state and clear the fields.

code:
handleSubmit = (e, values) => {
	...
        this.props.addItem(values);  
        this.resetFields();
 }

I would like the resetFields function to go off after addItem (from the parent) is successful.

It works now in its primitive state but I would eventually (I'm guessing) beef up addItem where if it fails, resetFields should not be run. I feel like I should move resetFields out of there and into maybe a lifecycle method and have addItem make the parent pass some prop down to trigger it.

Vincent Valentine
Feb 28, 2006

Murdertime

There are actually many ways to handle that. But first and foremost, .setState(which I assume is in your addItems function) is asynchronous, meaning you can make the handleSubmit function an async function, set a return value inside of addItems and then await that return. Once you have the return, you can use a simple ternary to decide whether or not resetFields will run. Here's a really dumb version of how to explain this.
code:
async handleSubmit = () => {
	var addResponse = await this.props.addItems();
	addResponse ? this.resetFields() : this.ohNoBadHappen
}
Failing that, react16 and above has error handling in the form of error boundary components, which have access to the componentDidCatch method. Any time an error is thrown, it works its way up the tree to find the nearest error boundary, where you can run fallbacks. You can learn more here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function and here: https://reactjs.org/blog/2017/07/26/error-handling-in-react-16.html

SimonChris
Apr 24, 2008

The Baron's daughter is missing, and you are the man to find her. No problem. With your inexhaustible arsenal of hard-boiled similes, there is nothing you can't handle.
Grimey Drawer
setState does not, however, return a promise. You have to feed it a callback function, which makes it really awkward to use as part of async code that uses promises and/or async/await. Facebook flat out refuses to change this because apparently doing something after setting the state is an anti-pattern (you are supposed to use the lifecycle methods instead). They still keep the callback parameter, though.

Boosh!
Apr 12, 2002
Oven Wrangler
Great! That was very informative, thank you both.

The Merkinman
Apr 22, 2007

I sell only quality merkins. What is a merkin you ask? Why, it's a wig for your genitals!
Why do people like you like frameworks? Are you weak or are you stupid? Or both?

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell


Everything about that is terrible and illogical and i wish i hadn't read it. Thanks!

Ok, well not everything. I do agree people should learn the basics. If you can't at least theoretically implement whatever framework you're using yourself, you're doing yourself a disservice.

Ither
Jan 30, 2010

But what are the basics though?

Should everyone know how to implement a GET request using Assembly?

my bony fealty
Oct 1, 2008

Tbh if you can't build a development environment from scratch, starting with mining and refining the raw materials from the pure depths of Earth, you shouldn't be using a computer for work at all

Analytic Engine
May 18, 2009

not the analytical engine
Small Brain: first frontend guy reinventing framework as they go in vanilla JS

Large Brain: arguing over React vs Vue

Galaxy Brain: forcing dozens of new hires to use first guy's spaghetti architecture

Analytic Engine
May 18, 2009

not the analytical engine

my bony fealty posted:

Tbh if you can't build a development environment from scratch, starting with mining and refining the raw materials from the pure depths of Earth, you shouldn't be using a computer for work at all
:woz:

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Ither posted:

But what are the basics though?

Whatever it is the framework is doing for you.

For example, if you're using React, you should probably understand how to update the DOM yourself. Understand why the virtual DOM is useful. Understand on some theoretical level how you'd implement something roughly like it.

If you're using a backend web framework, you should understand on a theoretical level how sockets work, how to respond to HTTP requests over them.

Even if you couldn't sit down and implement them yourself right now, you should be able to see a clear path from where you are to your own implementation.

I mean, it's not like you can't successfully use a framework if you can't do this, but you're going to be better if you can.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Thermopyle posted:

Whatever it is the framework is doing for you.

For example, if you're using React, you should probably understand how to update the DOM yourself. Understand why the virtual DOM is useful. Understand on some theoretical level how you'd implement something roughly like it.

If you're using a backend web framework, you should understand on a theoretical level how sockets work, how to respond to HTTP requests over them.

Even if you couldn't sit down and implement them yourself right now, you should be able to see a clear path from where you are to your own implementation.

I mean, it's not like you can't successfully use a framework if you can't do this, but you're going to be better if you can.

Nerd.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Analytic Engine posted:

Galaxy Brain: forcing dozens of new hires to use first guy's spaghetti architecture

This is me right now...

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell


Accurate.

I was thinking about my post last night and I think it sounded more confident than I actually am. I think it might be true, and I feel like once I got to that point it made me better, but I don't know if the concept applies generally.

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Thermopyle posted:

Everything about that is terrible and illogical and i wish i hadn't read it. Thanks!

Ok, well not everything. I do agree people should learn the basics. If you can't at least theoretically implement whatever framework you're using yourself, you're doing yourself a disservice.

Speaking as a former person who used frameworks and a JQuery, bootstrap and node.js contributor, I can see where this guy is coming from.

a) In 2012, this attitude was totally correct. In 2012, people were still using JQuery even though JQuery is worse than useless, and were really into monolithic frameworks that were slow, hard to debug, and sucked total rear end. I still remember people sucking the v8 engines dick even though all the performance measurements made the assumption that no one used a try catch anywhere in the call stack, I remember google closure, Kendo UI, and angular 1, all of which were hilariously terribly implemented and evidence that no one ever reads the source code of this poo poo before trying to make web sites. People would talk about unit testing and then write all sorts of crazy poo poo - like I remember a mocking framework that went on for pages about its unit tests, and it was all pages of, literally, "ninja.swing()" that asserted nothing. There was an endless progression of grunt/bower/etc - people would start using all these tools, the developer would get bored of fixing problems, and then the devs would jump to a new project.

b) 2017 has gotten a lot better - angular4 is actually a really smart web framework that has a lot of good features for writing maintainable SPA, including first class dependency injection support for components! .Net core is loving brilliant in that not only does it institutionalize first class dependency injection support, TestHost also always writing unit tests with a minimum of fuss. poo poo like babel and browserify actually work with a minimum of effort. Instead of SPA frameworks concentrating on solving the super difficult problem of "hey, you know, how do I update my view if my model changes, and vice versa", they provide useful features that you don't want to write yourself. Since JQuery is no longer a thing, you can actually loving use the "break on exceptions" feature in your browser's debugger without JQuery throwing exceptions in ordinary program flow whenever you move the mouse.

That said, my point would be more "think for yourself, don't be sheep." loving put breakpoints in the libraries you are including, step through them, and figure out how they work, and analyze for yourself why they have value! Don't just use libraries because some dude at a meetup tells you they're the next best thing.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell


Yeah, I agree.

I mostly just had an issue with his click-bait title and the theres-no-shades-of-gray-here attitude.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
as usual, arguing about programming metaphilosophy ends up going in circles with no new knowledge gained

my bony fealty
Oct 1, 2008

He misses one of the most important features a framework or library provides: universality.

Whole lot easier for me, someone who works with React, to jump into the React projects I inherited at work that were written by someone who also works with React, than it would be to try and untangle a dumpster of spaghetti, as was pointed out.

^^complaining about dumb JavaScript articles is its own reward

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Suspicious Dish posted:

as usual, arguing about programming metaphilosophy ends up going in circles with no new knowledge gained

What is knowledge, though, man?

geeves
Sep 16, 2004

Analytic Engine posted:

Small Brain: first frontend guy reinventing framework as they go in vanilla JS

Large Brain: arguing over React vs Vue

Galaxy Brain: forcing dozens of new hires to use first guy's spaghetti architecture

Can I call $rootScope from inside a jquery ajax callback on an onclick?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

geeves posted:

Can I call $rootScope from inside a jquery ajax callback on an onclick?

Just make it global and then go nuts.

Mr Shiny Pants
Nov 12, 2012
I just read the linked page and I think I can understand his reasoning, Its the same argument as with an ORM I guess, all the extra work you need to do to get stuff from the DB when, if you had just learned SQL in the first place, stuff would be lot simpler and faster. SQL is still alive and kicking but NHibernate seems to have lost a lot of love since MS came out with EF.
Not saying it is 100% the same for webdevelopment though.

Reading the last of couple of posts, I am that guy learning stuff and undoubtedly doing stupid stuff with plain javascript and HTML right now. :)
Got to start somewhere I guess, otherwise its hard to see the forest for the trees with all the web stuff. Usually this works out though, you come across some repetitive coding work and figure out why you want a framework for some tasks instead of the other way around.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Mr Shiny Pants posted:

I just read the linked page and I think I can understand his reasoning, Its the same argument as with an ORM I guess, all the extra work you need to do to get stuff from the DB when, if you had just learned SQL in the first place, stuff would be lot simpler and faster. SQL is still alive and kicking but NHibernate seems to have lost a lot of love since MS came out with EF.
Not saying it is 100% the same for webdevelopment though.

Reading the last of couple of posts, I am that guy learning stuff and undoubtedly doing stupid stuff with plain javascript and HTML right now. :)
Got to start somewhere I guess, otherwise its hard to see the forest for the trees with all the web stuff. Usually this works out though, you come across some repetitive coding work and figure out why you want a framework for some tasks instead of the other way around.

But that's a bad argument about ORMs.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo
Ooh is there a React SQL builder? It’d be a wild ride with SQL and Javascript and HTML all jumbled up in a single file, confusing whatever mouldy old syntax highlighter Atom ships with these days.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Mr Shiny Pants posted:

Its the same argument as with an ORM I guess, all the extra work you need to do to get stuff from the DB when, if you had just learned SQL in the first place, stuff would be lot simpler and faster.

That's a pretty bold assertion.

Mr Shiny Pants
Nov 12, 2012

a hot gujju bhabhi posted:

That's a pretty bold assertion.

That is what I was getting from his post. Maybe I read it wrong, but I read the just use CSS HTML etc. etc. as just use SQL like a lot of arguments against an ORM.

Mr Shiny Pants fucked around with this message at 08:33 on Jul 30, 2018

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Mr Shiny Pants posted:

I just read the linked page and I think I can understand his reasoning, Its the same argument as with an ORM I guess, all the extra work you need to do to get stuff from the DB when, if you had just learned SQL in the first place, stuff would be lot simpler and faster. SQL is still alive and kicking but NHibernate seems to have lost a lot of love since MS came out with EF.
Not saying it is 100% the same for webdevelopment though.

Reading the last of couple of posts, I am that guy learning stuff and undoubtedly doing stupid stuff with plain javascript and HTML right now. :)
Got to start somewhere I guess, otherwise its hard to see the forest for the trees with all the web stuff. Usually this works out though, you come across some repetitive coding work and figure out why you want a framework for some tasks instead of the other way around.

NHybernate and Entity Framework and all that stuff are great products. What unfortunately happened is that the underlying architecture of a product is generally dictated by the structure of the organization, so if you have, say a database team, it'll become it's own monolithic organization, and many organizations that made the horrible mistake of using, say, Oracle as their back-end database ended up with scores of Oracle dbas, programmers, and a generation of legacy databases. EF is great if you're doing a database from scratch and don't have a database team, much less if you have to adapt a ten year old database designed by people who don't understand 3NF and that there are other datatypes besides varchar - however most of the entity framework applications in the wild ended up being "make a lovely legacy application/database use EF" and EF got blamed for the original design being lovely, to say nothing about idiots who would find a slow query, and both rewrite it in standard SQL and somehow conclude it was writing the sql that hand that fixed the problem as opposed to, you know, having an index on the column that needed it.

Mr Shiny Pants
Nov 12, 2012

Bruegels Fuckbooks posted:

NHybernate and Entity Framework and all that stuff are great products. What unfortunately happened is that the underlying architecture of a product is generally dictated by the structure of the organization, so if you have, say a database team, it'll become it's own monolithic organization, and many organizations that made the horrible mistake of using, say, Oracle as their back-end database ended up with scores of Oracle dbas, programmers, and a generation of legacy databases. EF is great if you're doing a database from scratch and don't have a database team, much less if you have to adapt a ten year old database designed by people who don't understand 3NF and that there are other datatypes besides varchar - however most of the entity framework applications in the wild ended up being "make a lovely legacy application/database use EF" and EF got blamed for the original design being lovely, to say nothing about idiots who would find a slow query, and both rewrite it in standard SQL and somehow conclude it was writing the sql that hand that fixed the problem as opposed to, you know, having an index on the column that needed it.

Good points, I was merely commenting on the fact that, as pointed out in the link, when a framework goes out of fashion all your knowledge is essentially worthless because a lot of that knowledge is tied to a specific ORM implementation/framework and how it handles stuff under the hood ( query plans, architecture, do's and don'ts etc. ). Whereas the underlying technology is still the same SQL. So you could make a point that if you had just learned the underlying technology instead of trying to pretend you don't persist to a relational model you'd be better off in the long run.

Not saying an ORM is useless it's just that there is a lot of stuff written about them and I thought the point he makes has some overlap with criticisms I've read about ORMs.

Or I could be misunderstanding the whole thing, it happened before. :)

Mr Shiny Pants fucked around with this message at 10:49 on Jul 30, 2018

Mr Shiny Pants
Nov 12, 2012
I do have a question, I am writing some simple pages and do some Ajax calls in the background to retrieve some data from my server, like the user details for the currently logged on user.

Where do I put this data if I need to reuse it and don't want to do a request every time this data is needed?

Can I just put the data in a Global? That sounds not quite right, on the other hand it is just one piece of data which is unique to the page and which won't be changed but I need it in quite a few places.

SimonChris
Apr 24, 2008

The Baron's daughter is missing, and you are the man to find her. No problem. With your inexhaustible arsenal of hard-boiled similes, there is nothing you can't handle.
Grimey Drawer

Mr Shiny Pants posted:

I do have a question, I am writing some simple pages and do some Ajax calls in the background to retrieve some data from my server, like the user details for the currently logged on user.

Where do I put this data if I need to reuse it and don't want to do a request every time this data is needed?

Can I just put the data in a Global? That sounds not quite right, on the other hand it is just one piece of data which is unique to the page and which won't be changed but I need it in quite a few places.
https://reactjs.org/docs/context.html

If you are using React, you can put it in the top component, and use the new Context api to pass it down. If you are going to have a lot of state like this, you should consider learning Redux, or some similar state-handling system.

SimonChris fucked around with this message at 12:54 on Jul 30, 2018

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

Mr Shiny Pants posted:

Good points, I was merely commenting on the fact that, as pointed out in the link, when a framework goes out of fashion all your knowledge is essentially worthless because a lot of that knowledge is tied to a specific ORM implementation/framework and how it handles stuff under the hood ( query plans, architecture, do's and don'ts etc. ). Whereas the underlying technology is still the same SQL. So you could make a point that if you had just learned the underlying technology instead of trying to pretend you don't persist to a relational model you'd be better off in the long run.

Not saying an ORM is useless it's just that there is a lot of stuff written about them and I thought the point he makes has some overlap with criticisms I've read about ORMs.

Or I could be misunderstanding the whole thing, it happened before. :)

If only it was possible to learn two things.

Doh004
Apr 22, 2007

Mmmmm Donuts...
I *almost* have my Gatsby v2 site working with S3 and Cloudfront. Static sites are great and all, but you do have to reimplement a lot of things that traditional webservers make quite a lot easier. The last thing I need to figure out is why Cloudfront isn't gzipping my assets.

Going through all of this does provide more context as to why static site services like Netlify exist and why they're worth it.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Mr Shiny Pants posted:

That is what I was getting from his post. Maybe I read it wrong, but I read the just use CSS HTML etc. etc. as just use SQL like a lot of arguments against an ORM.

Well yeah, I mean you can compare the two trains of thought in the sense that they are both very ignorant.

Mr Shiny Pants posted:

Good points, I was merely commenting on the fact that, as pointed out in the link, when a framework goes out of fashion all your knowledge is essentially worthless because a lot of that knowledge is tied to a specific ORM implementation/framework and how it handles stuff under the hood ( query plans, architecture, do's and don'ts etc. ). Whereas the underlying technology is still the same SQL. So you could make a point that if you had just learned the underlying technology instead of trying to pretend you don't persist to a relational model you'd be better off in the long run.

Not saying an ORM is useless it's just that there is a lot of stuff written about them and I thought the point he makes has some overlap with criticisms I've read about ORMs.

Or I could be misunderstanding the whole thing, it happened before. :)

Why should you arbitrarily deny yourself access to tools instead of, say, using the tool while also learning how it works? In most cases even using the tool in and of itself will bring about some understanding of how it works as you problem solve with it. Progress is made by building on what others have done before you, not forcing everyone to go through the same hurdles just because.

putin is a cunt fucked around with this message at 05:02 on Jul 31, 2018

Ape Fist
Feb 23, 2007

Nowadays, you can do anything that you want; anal, oral, fisting, but you need to be wearing gloves, condoms, protection.
So I've spent the last year as an Angular 2 dev and I'm looking at skilling into React as I'm likely going to have to change roles relatively soon and there's 3 React jobs out there for every 1 Angular 2 job so obviously remaining competitive in the market is important.

Luckily a lot of the sort of basic principles of Angular obviously translate into React with a few exceptions, like Angular having more out of the box features than React and React & Angular just not being the same loving thing.

But it's mostly syntactical things that I'm interested in.

So a very basic Angular component might look like this:

code:
import { Component, OnInit } from '@angular/core'

@Component({
	selector: 'basic-component',
	template: `
		<div>{{_myFunction(myNumericVariable + mySecondNumbericVariable)}}</div>
	`
});
export class MyComponent implements OnInit {

	 public myNumericVariable: number = 1;
	 public mySecondNumbericVariable: number = 2;

	 constructor() {
	};

	onInit() {
	};

	public _myFunction(firstThing: number, secondThing: number): number {
		return firstThing + secondThing;
	};

}
How would this basic component, which when initialized, returns '3' to the console log be achieved in React?

I kinda figure it would be done something LIKE this but it's probably wrong:

code:
import React, { Component } from 'React';

export default class App {

	constructor(props) {
		super(props);
			this.state = {
			myNumericVariable = 1,
			mySecondNumbericVariable = 2
			}
	};

	_myFunction = (firstThing, secondThing) => {
		return firstThing + secondThing;
	}

	render() {
		return (
		<div>
			{this._myFunction(this.state.myNumericVariable + this.state.mySecondNumbericVariable)}
		</div>
		);
	}
}

export default App;

Ape Fist fucked around with this message at 20:32 on Jul 31, 2018

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Ape Fist posted:

So I've spent the last year as an Angular 2 dev and I'm looking at skilling into React as I'm likely going to have to change roles relatively soon and there's 3 React jobs out there for every 1 Angular 2 job so obviously remaining competitive in the market is important.

Luckily a lot of the sort of basic principles of Angular obviously translate into React with a few exceptions, like Angular having more out of the box features than React and React & Angular just not being the same loving thing.

But it's mostly syntactical things that I'm interested in.

So a very basic Angular component might look like this:

code:
import { Component, OnInit } from '@angular/core'

@Component({
	selector: 'basic-component',
	template: `
		<div>{{_myFunction(myNumericVariable + mySecondNumbericVariable)}}</div>
	`
});
export class MyComponent implements OnInit {

	 public myNumericVariable: number = 1;
	 public mySecondNumbericVariable: number = 2;

	 constructor() {
	};

	onInit() {
	};

	public _myFunction(firstThing: number, secondThing: number): number {
		return firstThing + secondThing;
	};

}
How would this basic component, which when initialized, returns '3' to the console log be achieved in React?

I kinda figure it would be done something LIKE this but it's probably wrong:

code:
import React, { Component } from 'React';

export default class App {

	constructor(props) {
		super(props);
			this.state = {
			myNumericVariable = 1,
			mySecondNumbericVariable = 2
			}
	};

	_myFunction = (firstThing, secondThing) => {
		return firstThing + secondThing;
	}

	render() {
		return (
		<div>
			{this._myFunction(this.state.myNumericVariable + this.state.mySecondNumbericVariable)}
		</div>
		);
	}
}

export default App;

JavaScript code:
// component
const Three = ({ numOne, numTwo }) => ( <div>{ numOne + numTwo }</div> )
export default Three

// usage
<Three numOne={ 1 } numTwo={ 2 } />
Or if you literally mean "console.log" it instead of rendering it:

JavaScript code:
// component
const Three = () => { console.log(1 + 2); return false; }
export default Three

// usage
<Three />

Lumpy fucked around with this message at 20:55 on Jul 31, 2018

Adbot
ADBOT LOVES YOU

Ape Fist
Feb 23, 2007

Nowadays, you can do anything that you want; anal, oral, fisting, but you need to be wearing gloves, condoms, protection.
Sorry I meant to template, woops.

So what I wrote in React wouldn't work then?

(at this point I'm not looking for the most efficient representation, just a comparative one.)

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply