Skip to content

Experiments with React and ArcGIS. This was done in the early stages of the move to ArcGIS and was never finished. Can probably be removed at some point.

Notifications You must be signed in to change notification settings

Cadasta/react-arcgis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cadasta React-Esri Client

Edit esri-react

Example app to explore how stuff works.

TODO


Development

This project was bootstrapped with Create React App using the TypeScript React Starter. More documentation can be found in either of those repositories' READMEs.

The codebase follows the conventions of Containers vs Components. It is strongly recommended that you familiarize yourself with those concepts.

Installation

yarn global add create-react-app # Install create-react-app
yarn # Install package dependencies

Running Server

yarn start

Running Tests

yarn test

React Fundamentals

When Rendering

  • No for loops, use .map:
    {
        // Remember that repeated elements must have a unique 'key' attribute
        ['apple', 'pear', 'orange'].map((fruit: string, index) => <h2 key={index}>{fruit}</h2>)
    }
  • No if statement, use &&:
    // this will only render the 'Yes' element if `isLoaded == true`
    { isLoaded && <h2>Yes!</h2>}
  • No if/else statements, use a conditional (ternary) operator:
    // this will only render the 'Yes' element if `isLoaded == true`, otherwised rendering the 'Nope' element
    { isLoaded ? <h2>Yes!</h2> : <h2>Nope!</h2> }

if and if/else statements are actually valid within React, however this codebase has an established pattern of using the above instead.

About

Experiments with React and ArcGIS. This was done in the early stages of the move to ArcGIS and was never finished. Can probably be removed at some point.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published