Skip to content

Commit 3b986a0

Browse files
committed
try to use lodash
1 parent 8f1b39c commit 3b986a0

File tree

5 files changed

+16
-1
lines changed

5 files changed

+16
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6+
"lodash": "^4.17.10",
67
"react": "^16.4.1",
78
"react-dom": "^16.4.1",
89
"react-scripts-ts": "2.16.0"

src/App.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ import './App.css';
33

44
import logo from './logo.svg';
55

6+
import _ from 'lodash';
7+
/*const _ = require('lodash')*/
8+
const foo = _.join(['f', 'oo']);
9+
610
class App extends React.Component {
711
public render() {
812
return (
913
<div className="App">
1014
<header className="App-header">
1115
<img src={logo} className="App-logo" alt="logo" />
12-
<h1 className="App-title">Welcome to React</h1>
16+
<h1 className="App-title">{foo}</h1>
1317
</header>
1418
<p className="App-intro">
1519
To get started, edit <code>src/App.tsx</code> and save to reload.

src/declarations.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module 'lodash'

src/foo.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import foo from './foo';
2+
3+
it('works', () => {
4+
expect(foo).toEqual('f,oo');
5+
})

src/foo.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import _ from 'lodash';
2+
3+
const foo = _.join(['f', 'oo']);
4+
export default foo;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy