in React JS by
Q:

How to define constants in React?

1 Answer

0 votes
by

You can use ES7 static field to define constant.

class MyComponent extends React.Component {
  static DEFAULT_PAGINATION = 10
}

Static fields are part of the Class Fields stage 3 proposal.

Click here to read more about React JS
Click here to read more about Insurance

Related questions

0 votes
asked Jan 31 in React JS by Robindeniel
0 votes
0 votes
asked Mar 3, 2020 in React JS by miceperry
+1 vote
asked Mar 2, 2020 in React JS by RShastri
0 votes
asked Jan 9, 2020 in Vue.JS by GeorgeBell
0 votes
asked Mar 4, 2020 in React JS by JackTerrance
...