DEV Community

Discussion on: Building a To-Do List with React-Native and Styled-Components.

Collapse
 
wendilyn15 profile image
wendilyn15

_styledComponents.default.View is not a function
Evaluating Components/AddInput.js
Evaluating App.js
Loading App.js
TypeError: _styledComponents.default.View is not a function
at Object.eval (Components/AddInput.js.js:29:35

at eval (Components/AddInput.js.js

at eval (Components/AddInput.js.js

at eval (<anonymous>)
at [snack internals]
at Object.a ([snack internals]
at e.evaluate ([snack internals]
at Ze ([snack internals]
at [snack internals]
at https://snack-web-player.s3.us-west-1.amazonaws.com/v2/41/static/js/app.9bb29d3a.chunk.js:1:14898
Enter fullscreen mode Exit fullscreen mode
Collapse
 
uzodike profile image
Uzodike Oguejiofor

From what I can deduce from this snippet, you probably did not install the Styled-Components library.
You need install the library first

npm install --save styled-components
Enter fullscreen mode Exit fullscreen mode

After installing the library, then import it into AddInput.js

import styled from "styled-components";
Enter fullscreen mode Exit fullscreen mode

If this doesn't work, send in the full code, I would love to be of help.