Skip to content

Cannot read properties of null (reading 'type') when using some shorthand boolean props #3

Description

@jmurth1234

I am getting the following error when trying to use this plugin

Module build failed (from /usr/local/lib/node_modules/expo-cli/node_modules/babel-loader/lib/index.js):
TypeError: /Users/murthick/Projects/native-base-babel-plugin/example/Screen3.tsx: Cannot read properties of null (reading 'type')
    at /Users/murthick/Projects/native-base-babel-plugin/index.js:228:34
    at Array.map (<anonymous>)
    at JSXOpeningElement (/Users/murthick/Projects/native-base-babel-plugin/index.js:214:25)

This can be reproduced in the example by adding a bounces prop for instance to the ScrollView in Screen3.tsx

import React from "react";
import { Box, ScrollView, Heading, Center, HStack } from "native-base";

export default function Screen3() {
  return (
    <ScrollView bounces>

If this prop is used in the long way then it works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions